0.2: Edit stats, clear stats features added

This commit is contained in:
Johnny Bergström
2005-01-22 13:24:26 +00:00
parent 7f47d2de56
commit 27e4174be6
6 changed files with 197 additions and 23 deletions

View File

@@ -153,16 +153,32 @@ RankSystem::RankStats* RankSystem::findEntryInRank(const char* unique, const cha
while ( a )
{
if ( strcmp( a->getUnique() ,unique ) == 0 )
if ( strcmp( a->getUnique(), unique ) == 0 )
return a;
a = a->prev;
}
a = new RankStats( unique ,name,this );
if ( a == 0 ) return 0;
put_after( a , 0 );
return a;
}
RankSystem::RankStats* RankSystem::findEntryInRankByUnique(const char* unique)
{
RankStats* a = head;
while ( a )
{
if ( strcmp( a->getUnique(), unique ) == 0 )
return a;
a = a->prev;
}
return NULL; // none found
}
RankSystem::RankStats* RankSystem::findEntryInRankByPos(int position)
{
RankStats* a = head;
@@ -175,12 +191,14 @@ RankSystem::RankStats* RankSystem::findEntryInRankByPos(int position)
a = a->prev;
}
return a;
return NULL;
}
void RankSystem::updatePos( RankStats* rr , Stats* s )
int RankSystem::updatePos( RankStats* rr , Stats* s )
{
rr->addStats( s );
RankStats* rrFirst = rr;
if (s != NULL)
rr->addStats( s );
if ( calc.code ) {
calc.physAddr1[0] = rr->kills;
calc.physAddr1[1] = rr->deaths;
@@ -230,7 +248,7 @@ void RankSystem::updatePos( RankStats* rr , Stats* s )
put_after( rr, aa );
}
}
return rrFirst->getPosition();
}
bool RankSystem::loadRank( const char* filename )