From 42708386138aea39d712df72b80a410e92243b4a Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Sat, 12 Apr 2014 22:02:19 +1200 Subject: [PATCH] CANRAISE state definition CANRAISE state for allowing a monster to be resurrected without an infinite frame --- src/info.h | 5 +++++ src/p_enemy.cpp | 5 +++-- src/thingdef/thingdef_states.cpp | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/info.h b/src/info.h index 24bbb5fea..9a316c78d 100644 --- a/src/info.h +++ b/src/info.h @@ -76,6 +76,7 @@ struct FState BYTE SameFrame:1; // Ignore Frame (except when spawning actor) BYTE Fast:1; BYTE NoDelay:1; // Spawn states executes its action normally + BYTE CanRaise:1; // Allows a monster to be resurrected without waiting for an infinate frame int ParameterIndex; inline int GetFrame() const @@ -114,6 +115,10 @@ struct FState { return NoDelay; } + inline bool GetCanRaise() const + { + return CanRaise; + } inline void SetFrame(BYTE frame) { Frame = frame - 'A'; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index df1698837..8b1dd951b 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2527,8 +2527,9 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) if (!(corpsehit->flags & MF_CORPSE) ) continue; // not a monster - if (corpsehit->tics != -1) - continue; // not lying still yet + if (corpsehit->tics != -1 && // not lying still yet + !corpsehit->state->GetCanRaise()) // or not ready to be raised yet + continue; raisestate = corpsehit->FindState(NAME_Raise); if (raisestate == NULL) diff --git a/src/thingdef/thingdef_states.cpp b/src/thingdef/thingdef_states.cpp index 1d643e33c..5cc2de1c0 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/thingdef/thingdef_states.cpp @@ -313,6 +313,11 @@ do_stop: sc.MustGetStringName(")"); continue; } + if (sc.Compare("CANRAISE")) + { + state.CanRaise = true; + continue; + } // Make the action name lowercase strlwr (sc.String);