Get correct track groups for soccer/battle mode

This commit is contained in:
Deve 2018-10-07 21:45:48 +02:00
parent 0766df61f2
commit 2888f6ee2d

View File

@ -198,7 +198,13 @@ void TracksScreen::beforeAddingWidget()
RibbonWidget* tabs = getWidget<RibbonWidget>("trackgroups");
tabs->clearAllChildren();
const std::vector<std::string>& groups = track_manager->getAllTrackGroups();
RaceManager::MinorRaceModeType minor_mode = race_manager->getMinorMode();
bool is_soccer = minor_mode == RaceManager::MINOR_MODE_SOCCER;
bool is_arena = is_soccer || minor_mode == RaceManager::MINOR_MODE_BATTLE;
const std::vector<std::string>& groups =
is_arena ? track_manager->getAllArenaGroups(is_soccer)
: track_manager->getAllTrackGroups();
const int group_amount = (int)groups.size();
if (group_amount > 1)