gate frame fix
[carveJwlIkooP6JGAAIwe30JlM.git] / highscores.h
index b1c9cc0a5d591794388213552ab1938a75003a0b..2c077b1038a9d9f5fdf90fe8ba855a005d3243ff 100644 (file)
@@ -293,6 +293,23 @@ static int highscores_serialize_all(void)
    return 1;
 }
 
+static highscore_record *highscore_find_user_record( u64 playerid, u32 trackid )
+{
+   struct highscore_system *sys = &highscore_system;
+
+   highscore_track_table *table = &sys->dbheader.tracks[trackid];
+   highscore_record temp;
+   temp.playerid = playerid;
+
+   aatree_ptr find = 
+      aatree_find( &sys->aainfo_playerid, table->root_playerid, &temp );
+
+   if( find == AATREE_PTR_NIL )
+      return NULL;
+
+   return aatree_get_data( &sys->aainfo_playerid, find );
+}
+
 static aatree_ptr highscores_push_record( highscore_record *record )
 {
    struct highscore_system *sys = &highscore_system;
@@ -578,11 +595,11 @@ static void highscores_board_generate( char *buf, u32 id, u32 count )
          highscore_strl( line+3, inf->nickname, 10 );
       }
 
-      u16 miliseconds = record->time,
-          seconds     = miliseconds / 100,
-          minutes     = seconds / 60;
+      u16 centiseconds = record->time,
+          seconds      = centiseconds / 100,
+          minutes      = seconds / 60;
 
-      miliseconds %= 100;
+      centiseconds %= 100;
       seconds     %= 60;
       minutes     %= 60;
 
@@ -593,10 +610,10 @@ static void highscores_board_generate( char *buf, u32 id, u32 count )
       line[15] = ':';
       highscore_intr( line+16, seconds, 2, '0' );
       line[18] = '.';
-      highscore_intr( line+19, miliseconds, 2, '0' );
+      highscore_intr( line+19, centiseconds, 2, '0' );
 
       /* Score */
-      highscore_intl( line+22, record->time, 5 );
+      highscore_intl( line+22, record->points, 5 );
       it = aatree_next( &sys->aainfo_time, it );
    }
 }