* 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-861f7616d084master
parent
ed62f3da96
commit
d593fd7c17
6
src/ai.c
6
src/ai.c
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue