From aea7a001c5596a748fb0dc19c88d7ef95a7ce507 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Wed, 3 Apr 2013 11:12:25 +0000 Subject: [PATCH] Bugfix: when playing batle mode, the number of karts is set to the number of players (independent on the number of AIs selected), and UserConfigParam::m_num_karts is not changed (which is correct imho). When then a single race is started, the displayed number of AIs is based on this m_num_karts. But if a normal race is started (without adjusting the number of AI karts), the number of karts in the race_manager was not updated (it is only updated when changing the number of AIs), resulting in the wrong number of karts to be used (based on the battle mode, and not based on the number shown in the GUI). This patch just updates the race_manager with the number of AI karts that is shown in the GUI, so that those values are now in synch. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12592 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/states_screens/race_setup_screen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/states_screens/race_setup_screen.cpp b/src/states_screens/race_setup_screen.cpp index ea9aeb48b..ba304caab 100644 --- a/src/states_screens/race_setup_screen.cpp +++ b/src/states_screens/race_setup_screen.cpp @@ -209,6 +209,7 @@ void RaceSetupScreen::init() if(num_ai<0) num_ai = 0; kartamount->setValue(num_ai); kartamount->setMax(stk_config->m_max_karts - race_manager->getNumLocalPlayers() ); + race_manager->setNumKarts(num_ai + race_manager->getNumLocalPlayers()); DynamicRibbonWidget* w2 = getWidget("gamemode"); assert( w2 != NULL );