From d527829ee3fcc25dc4c78477f2fae1d2aa8da248 Mon Sep 17 00:00:00 2001 From: Boondorl Date: Tue, 28 Jan 2025 10:49:43 -0500 Subject: [PATCH] Added NOAUTOOFFSKULLFLY flag Disables resetting skullfly and state when velocity is zero while charging. --- src/playsim/actor.h | 1 + src/playsim/p_mobj.cpp | 2 +- src/scripting/thingdef_data.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/playsim/actor.h b/src/playsim/actor.h index edd04cee5f..583050bb56 100644 --- a/src/playsim/actor.h +++ b/src/playsim/actor.h @@ -446,6 +446,7 @@ enum ActorFlag9 MF9_NOSECTORDAMAGE = 0x00000020, // [inkoalawetrust] Actor ignores any sector-based damage (i.e damaging floors, NOT crushers) MF9_ISPUFF = 0x00000040, // [AA] Set on actors by P_SpawnPuff MF9_FORCESECTORDAMAGE = 0x00000080, // [inkoalawetrust] Actor ALWAYS takes hurt floor damage if there's any. Even if the floor doesn't have SECMF_HURTMONSTERS. + MF9_NOAUTOOFFSKULLFLY = 0x00000100, // Don't automatically disable MF_SKULLFLY if velocity is 0. }; // --- mobj.renderflags --- diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 9bc1854719..1552ed9f54 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -2105,7 +2105,7 @@ static double P_XYMovement (AActor *mo, DVector2 scroll) if (move.isZero()) { - if (mo->flags & MF_SKULLFLY) + if ((mo->flags & MF_SKULLFLY) && !(mo->flags9 & MF9_NOAUTOOFFSKULLFLY)) { // the skull slammed into something mo->flags &= ~MF_SKULLFLY; diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 8692936c11..e17e28c351 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -354,6 +354,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(MF9, NOSECTORDAMAGE, AActor, flags9), DEFINE_PROTECTED_FLAG(MF9, ISPUFF, AActor, flags9), //[AA] was spawned by SpawnPuff DEFINE_FLAG(MF9, FORCESECTORDAMAGE, AActor, flags9), + DEFINE_FLAG(MF9, NOAUTOOFFSKULLFLY, AActor, flags9), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),