mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-20 06:53:00 +00:00
M_StatisticsChars: Sort for descending rounds completed
This commit is contained in:
parent
96b784defd
commit
cea9a80b2a
1 changed files with 13 additions and 0 deletions
|
|
@ -166,6 +166,19 @@ static void M_StatisticsChars(void)
|
|||
|
||||
statisticsmenu.maplist[statisticsmenu.nummaps] = MAXSKINS;
|
||||
|
||||
std::sort(
|
||||
statisticsmenu.maplist,
|
||||
statisticsmenu.maplist + statisticsmenu.nummaps,
|
||||
[](UINT16 a, UINT16 b) {
|
||||
if (skins[a].records.rounds > skins[b].records.rounds)
|
||||
return true;
|
||||
if (skins[a].records.rounds != skins[b].records.rounds)
|
||||
return false;
|
||||
// Stable for skin ID
|
||||
return (a < b);
|
||||
}
|
||||
);
|
||||
|
||||
statisticsmenu.location = 0;
|
||||
statisticsmenu.maxscroll = statisticsmenu.nummaps - 6;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue