I just checked how P_LookForPlayers works, and it turns out it doesn't modify the target *unless* it returns true. So I guess we've no need to account for a change in target in A_LookForBetter after all?

This commit is contained in:
Monster Iestyn 2019-05-05 14:09:09 +01:00
parent 09368963dd
commit 9e26d7bdaa

View file

@ -12385,16 +12385,11 @@ void A_LookForBetter(mobj_t *actor)
{
INT32 locvar1 = var1;
//INT32 locvar2 = var2;
mobj_t *oldtarget = NULL;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_LookForBetter", actor))
return;
#endif
oldtarget = actor->target;
if (!P_LookForPlayers(actor, (locvar1 & 65535), false, FixedMul((locvar1 >> 16)*FRACUNIT, actor->scale)))
actor->target = oldtarget;
P_LookForPlayers(actor, (locvar1 & 65535), false, FixedMul((locvar1 >> 16)*FRACUNIT, actor->scale));
A_FaceTarget(actor);
}