Fixed in bug in the device manager that could cause crashes

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3734 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2009-07-11 19:29:33 +00:00
parent ab4cdcae00
commit ab4787f884

View File

@@ -146,9 +146,9 @@ bool DeviceManager::mapInputToPlayerAndAction( Input::InputType type, int device
// stored inside the device so we don't need to iterate through players
const ptr_vector<ActivePlayer, HOLD>& players = StateManager::getActivePlayers();
const int playerAmount = players.size();
for(int n=0; n<playerAmount; n++)
for(int p=0; p<playerAmount; p++)
{
if(players[n].getDevice() == m_keyboards.get(n))
if(players[p].getDevice() == m_keyboards.get(n))
{
// we found which active player has this binding
*player = n;
@@ -162,7 +162,7 @@ bool DeviceManager::mapInputToPlayerAndAction( Input::InputType type, int device
return true;
}
}
} // end for player
// no active player has this binding. if we want to check for new players trying to join,
// check now