Fix bug where a check for player < max number of players is toos trick. Closes ticket:762

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7909 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2009-07-28 16:37:50 +00:00 committed by Git SVN Gateway
parent a015282a1e
commit 1d80719f5a
1 changed files with 4 additions and 1 deletions

View File

@ -464,7 +464,10 @@ BOOL setPlayerName(UDWORD player, const char *sName)
// to determine human/computer players and responsibilities of each.. // to determine human/computer players and responsibilities of each..
BOOL isHumanPlayer(UDWORD player) BOOL isHumanPlayer(UDWORD player)
{ {
ASSERT_OR_RETURN(false, player < MAX_PLAYERS, "Player index (%u) out of range", player); if (player >= MAX_PLAYERS)
{
return false; // obvious, really
}
return NetPlay.players[player].allocated; return NetPlay.players[player].allocated;
} }