mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-16 09:11:21 +00:00
Added GoalReached(Actor oldgoal) function to actors.
This commit is contained in:
parent
ebc36650a4
commit
895462c46a
2 changed files with 18 additions and 2 deletions
|
@ -2371,6 +2371,20 @@ nosee:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void GoalReached(AActor* self, AActor* oldgoal)
|
||||
{
|
||||
if (self && self->Level)
|
||||
self->Level->localEventManager->WorldThingGoalReached(self, oldgoal);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, GoalReached)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT(oldgoal, AActor);
|
||||
GoalReached(self, oldgoal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// A_Chase
|
||||
|
@ -2594,8 +2608,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
|
|||
}
|
||||
actor->flags7 &= ~MF7_INCHASE;
|
||||
actor->goal = newgoal;
|
||||
if (actor->goal != savedgoal)
|
||||
actor->Level->localEventManager->WorldThingGoalReached(actor, savedgoal);
|
||||
GoalReached(actor, savedgoal);
|
||||
return;
|
||||
}
|
||||
if (actor->goal == actor->target) goto nomissile;
|
||||
|
|
|
@ -813,6 +813,9 @@ class Actor : Thinker native
|
|||
movecount = random[TryWalk](0, 15);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Calls WorldThingGoalReached.
|
||||
native void GoalReached(Actor oldgoal);
|
||||
|
||||
native bool TryMove(vector2 newpos, int dropoff, bool missilecheck = false, FCheckPosition tm = null);
|
||||
native bool CheckMove(vector2 newpos, int flags = 0, FCheckPosition tm = null);
|
||||
|
|
Loading…
Reference in a new issue