handle maximum number of players in kart selection screen

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4912 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2010-03-03 00:56:34 +00:00
parent c17f4f0e07
commit 9e1ce6db4e

View File

@@ -859,6 +859,13 @@ bool KartSelectionScreen::playerJoin(InputDevice* device, bool firstPlayer)
return false;
}
if (StateManager::get()->activePlayerCount() >= MAX_PLAYER_COUNT)
{
std::cerr << "Maximum number of players reached\n";
sfx_manager->quickSound( "use_anvil" );
return false;
}
// ---- Get available area for karts
// make a copy of the area, ands move it to be outside the screen
Widget kartsArea = *this->getWidget("playerskarts"); // copy