Skip to content

Commit

Permalink
Don't go past the map's player limits when allocating players. fixes …
Browse files Browse the repository at this point in the history
…ticket:3089
  • Loading branch information
vexed committed Feb 4, 2012
1 parent 4072208 commit 7f7390c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/netplay/netplay.cpp
Expand Up @@ -365,7 +365,8 @@ static signed int NET_CreatePlayer(const char* name)
{
signed int index;

for (index = 0; index < MAX_CONNECTED_PLAYERS; index++)
// only look for spots up to the max players allowed on the map
for (index = 0; index < gamestruct.desc.dwMaxPlayers; index++)
{
if (NetPlay.players[index].allocated == false && NetPlay.players[index].ai == AI_OPEN)
{
Expand Down

0 comments on commit 7f7390c

Please sign in to comment.