From 1d80719f5a4dd40e9391db54b2ba91ac2e00f836 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Tue, 28 Jul 2009 16:37:50 +0000 Subject: [PATCH] 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 --- src/multiplay.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/multiplay.c b/src/multiplay.c index 6f862897a..60d2db994 100644 --- a/src/multiplay.c +++ b/src/multiplay.c @@ -464,7 +464,10 @@ BOOL setPlayerName(UDWORD player, const char *sName) // to determine human/computer players and responsibilities of each.. 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; }