From 92bc1c2a17eb6d02e11024ebd51e77de347731e5 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 18 Mar 2024 22:15:30 -0700 Subject: [PATCH] Sort staff replays - This lets the 1st replay on the "Replay Staff" selector actually be the fastest one --- src/p_setup.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 1cc4c9cd3..5e472be84 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -9215,6 +9215,13 @@ UINT8 P_InitMapData(void) mapheaderinfo[i]->ghostBrief[mapheaderinfo[i]->ghostCount] = briefghost; mapheaderinfo[i]->ghostCount++; } + + // Sort shortest to longest for Time Attack menu + std::sort( + mapheaderinfo[i]->ghostBrief, + mapheaderinfo[i]->ghostBrief + mapheaderinfo[i]->ghostCount, + [](staffbrief_t* a, staffbrief_t* b) { return a->time < b->time; } + ); } P_DeriveAutoMedalTimes(*mapheaderinfo[i]);