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
This commit is contained in:
hikerstk 2013-04-03 11:12:25 +00:00
parent 820ebd2673
commit aea7a001c5

View File

@ -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<DynamicRibbonWidget>("gamemode");
assert( w2 != NULL );