diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 212ca5287..767e3a3b2 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ February 3, 2009 +- Moved the MF_INCHASE recursion check from A_Look() into A_Chase(). This + lets A_Look() always put the actor into its see state. This problem could + be heard by an Archvile's resurrectee playing its see sound but failing to + enter its see state because it was called from A_Chase(). - Fixed: SBARINFO used different rounding modes for the background and foreground of the DrawBar command. - Bumped MINSAVEVER to coincide with the new MAPINFO merge. diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 851634c3a..e4abed26f 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -1590,10 +1590,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look) // Let the self wander around aimlessly looking for a fight if (self->SeeState != NULL) { - if (!(self->flags & MF_INCHASE)) - { - self->SetState (self->SeeState); - } + self->SetState (self->SeeState); } else { @@ -1638,7 +1635,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look) } } - if (self->target && !(self->flags & MF_INCHASE)) + if (self->target) { self->SetState (self->SeeState); } @@ -1757,6 +1754,10 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi { int delta; + if (actor->flags & MF_INCHASE) + { + return; + } actor->flags |= MF_INCHASE; // [RH] Andy Baker's stealth monsters @@ -2183,7 +2184,6 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) S_Sound (corpsehit, CHAN_BODY, "vile/raise", 1, ATTN_IDLE); info = corpsehit->GetDefault (); - corpsehit->SetState (raisestate); corpsehit->height = info->height; // [RH] Use real mobj height corpsehit->radius = info->radius; // [RH] Use real radius /* @@ -2207,6 +2207,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) // You are the Archvile's minion now, so hate what it hates corpsehit->CopyFriendliness (self, false); + corpsehit->SetState (raisestate); return true; }