Fix ticket 342 - out of range path node crashes game

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6905 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2009-03-29 13:57:10 +00:00 committed by Git SVN Gateway
parent 2ad693b643
commit 60fe79b68f
1 changed files with 4 additions and 1 deletions

View File

@ -137,7 +137,10 @@ static FP_NODE* fpathGetNode(int x, int y)
{
FP_NODE * psFound;
ASSERT(x < ARRAY_SIZE(nodeArray) && y < ARRAY_SIZE(nodeArray[x]), "X (%d) or Y %d) coordinate for path finding node is out of range!", x, y);
if (x < 0 || y < 0 || x >= ARRAY_SIZE(nodeArray) || y >= ARRAY_SIZE(nodeArray[x]))
{
return NULL;
}
psFound = nodeArray[x][y];
if (psFound