* Verify a target isn't dead before using it

Patch by Watermelon

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2031 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-07-06 19:17:44 +00:00
parent ed62f3da96
commit d593fd7c17
1 changed files with 5 additions and 1 deletions

View File

@ -167,7 +167,11 @@ SDWORD aiBestNearestTarget(DROID *psDroid, BASE_OBJECT **ppsObj, int weapon_slot
}
else if(friendlyObj->type == OBJ_STRUCTURE)
{
targetInQuestion = ((STRUCTURE *)friendlyObj)->psTarget[0];
tempTarget = ((STRUCTURE*)friendlyObj)->psTarget[0];
if (tempTarget && !tempTarget->died)
{
targetInQuestion = tempTarget;
}
}
}
}