From: <hik...@us...> - 2007-09-26 06:18:27
|
Revision: 1262 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=1262&view=rev Author: hikerstk Date: 2007-09-25 23:18:24 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Applied a modified version of Robert's patch for bug 1799457 (multiplayer does not work ... if the number of karts in the config file is lower than the number of karts needed for multiplayer). Modified Paths: -------------- trunk/supertuxkart/src/race_manager.cpp Modified: trunk/supertuxkart/src/race_manager.cpp =================================================================== --- trunk/supertuxkart/src/race_manager.cpp 2007-09-26 03:43:02 UTC (rev 1261) +++ trunk/supertuxkart/src/race_manager.cpp 2007-09-26 06:18:24 UTC (rev 1262) @@ -66,10 +66,8 @@ std::vector<std::string> kart_names; - // make sure we have a valid number of karts - if ((m_num_karts < 0) || (m_num_karts > NUM_PLAYERS + int(kart_properties_manager->getNumberOfKarts()))) { - m_num_karts = NUM_PLAYERS + kart_properties_manager->getNumberOfKarts(); - } + if(m_num_karts < 0 ) m_num_karts = stk_config->m_max_karts; + if(m_num_karts < m_players.size()) m_num_karts = m_players.size(); kart_names.resize(m_num_karts); @@ -166,9 +164,8 @@ : m_track(track_), m_players(players_), m_difficulty(difficulty_), m_num_karts(numKarts_), m_num_laps(numLaps_) { - if ((m_num_karts<0) || (m_num_karts > int(kart_properties_manager->getNumberOfKarts() + m_players.size()))) { - m_num_karts = kart_properties_manager->getNumberOfKarts() + m_players.size(); - } + if(m_num_karts < 0 ) m_num_karts = stk_config->m_max_karts; + if(m_num_karts < m_players.size()) m_num_karts = m_players.size(); } //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |