diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 45dd9ff49d..d17bbc75ff 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1768,6 +1768,7 @@ enum SIX_Flags SIXF_SETTARGET = 1 << 20, SIXF_SETTRACER = 1 << 21, SIXF_NOPOINTERS = 1 << 22, + SIXF_ORIGINATOR = 1 << 23, }; static bool InitSpawnedItem(AActor *self, AActor *mo, int flags) @@ -1803,11 +1804,13 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags) { mo->pitch = self->pitch; } - while (originator && originator->isMissile()) + if (!(flags & SIXF_ORIGINATOR)) { - originator = originator->target; - } - + while (originator && originator->isMissile()) + { + originator = originator->target; + } + } if (flags & SIXF_TELEFRAG) { P_TeleportMove(mo, mo->x, mo->y, mo->z, true); @@ -5003,7 +5006,7 @@ static void DoKill(AActor *killtarget, AActor *self, FName damagetype, int flags //since that's the whole point of it. if ((!(killtarget->flags2 & MF2_INVULNERABLE) || (flags & KILS_FOILINVUL)) && !(killtarget->flags5 & MF5_NODAMAGE)) { - P_ExplodeMissile(self->target, NULL, NULL); + P_ExplodeMissile(killtarget, NULL, NULL); } } if (!(flags & KILS_NOMONSTERS)) @@ -5113,9 +5116,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillSiblings) enum RMVF_flags { - RMVF_MISSILES = 1 << 0, + RMVF_MISSILES = 1 << 0, RMVF_NOMONSTERS = 1 << 1, - RMVF_MISC = 1 << 2, + RMVF_MISC = 1 << 2, RMVF_EVERYTHING = 1 << 3, }; diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 5e9eb2d6d2..da289dc50e 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -70,6 +70,7 @@ const int SXF_TRANSFERRENDERSTYLE = 1 << 19; const int SXF_SETTARGET = 1 << 20; const int SXF_SETTRACER = 1 << 21; const int SXF_NOPOINTERS = 1 << 22; +const int SXF_ORIGINATOR = 1 << 23; // Flags for A_Chase const int CHF_FASTCHASE = 1;