* Make sure to check the died status of objects and set pointers to them to NULL if they're dead
* Treat objects that have there status set to died should be treated similar to NULL pointers to droids Patches aipsactiontargetfix & projfix by Watermelon in mail with Message-ID: <ca0601900706260022h69c31e06lb993dd8679d77482@mail.gmail.com> on the development mailinglist git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1982 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
225a70c1f1
commit
17e25433e0
2
src/ai.c
2
src/ai.c
|
@ -145,7 +145,7 @@ SDWORD aiBestNearestTarget(DROID *psDroid, BASE_OBJECT **ppsObj, int weapon_slot
|
|||
|
||||
/* See if friendly droid has a target */
|
||||
tempTarget = friendlyDroid->psActionTarget[0];
|
||||
if(tempTarget != NULL)
|
||||
if(tempTarget && !tempTarget->died)
|
||||
{
|
||||
//make sure a weapon droid is targeting it
|
||||
if(friendlyDroid->numWeaps > 0)
|
||||
|
|
|
@ -399,7 +399,7 @@ proj_SendProjectile( WEAPON *psWeap, BASE_OBJECT *psAttacker, SDWORD player,
|
|||
|
||||
ASSERT(psProj->type == OBJ_BULLET, "Penetrating but not projectile?");
|
||||
psObj->psSource = psProj->psSource;
|
||||
psObj->psDamaged = psProj->psDest;
|
||||
psObj->psDamaged = (psProj->psDest && !psProj->psDest->died) ? psProj->psDest : NULL;
|
||||
psProj->state = PROJ_IMPACT;
|
||||
}
|
||||
else
|
||||
|
@ -1894,6 +1894,10 @@ proj_Update( PROJ_OBJECT *psObj )
|
|||
{
|
||||
psObj->psDest = NULL;
|
||||
}
|
||||
if (psObj->psDamaged && psObj->psDamaged->died)
|
||||
{
|
||||
psObj->psDamaged = NULL;
|
||||
}
|
||||
|
||||
//Watermelon:get naybors
|
||||
projGetNaybors((PROJ_OBJECT *)psObj);
|
||||
|
|
Loading…
Reference in New Issue