mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- Fixed: Thing_SetGoal could put an actor's target and goal out of sync.
If an actor is already targeting a goal, and Thing_SetGoal is used on it, it would still be left targeting the old goal instead of the new one. This messed up checks in A_Chase for walking towards a goal vs a real target.
This commit is contained in:
parent
ad7aefff20
commit
5850279090
1 changed files with 14 additions and 2 deletions
|
@ -1562,9 +1562,21 @@ FUNC(LS_Thing_SetGoal)
|
|||
ok = true;
|
||||
if (self->flags & MF_SHOOTABLE)
|
||||
{
|
||||
if (self->target == self->goal)
|
||||
{ // Targeting a goal already? -> don't target it anymore.
|
||||
// A_Look will set it to the goal, presuming no real targets
|
||||
// come into view by then.
|
||||
self->target = NULL;
|
||||
}
|
||||
self->goal = goal;
|
||||
if (arg3 == 0) self->flags5 &=~ MF5_CHASEGOAL;
|
||||
else self->flags5 |= MF5_CHASEGOAL;
|
||||
if (arg3 == 0)
|
||||
{
|
||||
self->flags5 &= ~MF5_CHASEGOAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->flags5 |= MF5_CHASEGOAL;
|
||||
}
|
||||
if (self->target == NULL)
|
||||
{
|
||||
self->reactiontime = arg2 * TICRATE;
|
||||
|
|
Loading…
Reference in a new issue