From 5799aa6dc3e8a80f8da57dec19fc17333ce96a8e Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Fri, 28 Aug 2009 17:20:20 +0000 Subject: [PATCH] Add assert or return check for bad player numbers for allianceExists script function. This is needed to make BP run on trunk with --noassert. git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8060 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/scriptfuncs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scriptfuncs.c b/src/scriptfuncs.c index 7c46f86df..474dd9eb7 100644 --- a/src/scriptfuncs.c +++ b/src/scriptfuncs.c @@ -4206,6 +4206,8 @@ BOOL scrAllianceExistsBetween(void) { return false; } + ASSERT_OR_RETURN(false, i < MAX_PLAYERS && j < MAX_PLAYERS && i >= 0 && j >= 0, + "Invalid player parameters %d and %d", i, j); if(alliances[i][j] == ALLIANCE_FORMED) { scrFunctionResult.v.bval = true;