From 3c3fbb86a83ddc3e66374432db6eb9157bbf9f11 Mon Sep 17 00:00:00 2001 From: CodingJellyfish Date: Mon, 28 Oct 2024 22:15:06 +0800 Subject: [PATCH] Fix duplicate tracks in online battle --- src/states_screens/online/tracks_screen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/states_screens/online/tracks_screen.cpp b/src/states_screens/online/tracks_screen.cpp index 434c8e9f65..b6d2ec407d 100644 --- a/src/states_screens/online/tracks_screen.cpp +++ b/src/states_screens/online/tracks_screen.cpp @@ -631,6 +631,8 @@ void TracksScreen::buildTrackList() curr_tracks.insert(curr_tracks.end(), curr_arenas.begin(), curr_arenas.end()); curr_tracks.insert(curr_tracks.end(), curr_soccers.begin(), curr_soccers.end()); + std::sort(curr_tracks.begin(), curr_tracks.end()); + curr_tracks.resize(std::unique(curr_tracks.begin(), curr_tracks.end()) - curr_tracks.begin()); const int track_amount = (int)curr_tracks.size();