From 162dbf0554907a3f5988c7f9a1c7cfcf10b47425 Mon Sep 17 00:00:00 2001 From: inkoalawetrust <56005600+inkoalawetrust@users.noreply.github.com> Date: Mon, 16 Jan 2023 21:44:54 +0200 Subject: [PATCH] Added MF9_SHADOWAIM. This flag allows actors with MF6_SEEINVISIBLE to still get an aim penalty by trying to shoot at a shadow actor. --- src/playsim/actor.h | 6 +++--- src/playsim/p_mobj.cpp | 2 +- src/playsim/shadowinlines.h | 2 +- src/scripting/thingdef_data.cpp | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/playsim/actor.h b/src/playsim/actor.h index 8239f3e11..199c93a98 100644 --- a/src/playsim/actor.h +++ b/src/playsim/actor.h @@ -393,7 +393,7 @@ enum ActorFlag7 MF7_SPRITEANGLE = 0x02000000, // [MC] Utilize the SpriteAngle property and lock the rotation to the degrees specified. MF7_SMASHABLE = 0x04000000, // dies if hitting the floor. MF7_NOSHIELDREFLECT = 0x08000000, // will not be reflected by shields. - MF7_FORCEZERORADIUSDMG = 0x10000000, // passes zero radius damage on to P_DamageMobj, this is necessary in some cases where DoSpecialDamage gets overrideen. + MF7_FORCEZERORADIUSDMG = 0x10000000,// passes zero radius damage on to P_DamageMobj, this is necessary in some cases where DoSpecialDamage gets overrideen. MF7_NOINFIGHTSPECIES = 0x20000000, // don't start infights with one's own species. MF7_FORCEINFIGHTING = 0x40000000, // overrides a map setting of 'no infighting'. MF7_INCHASE = 0x80000000, // [RH] used by A_Chase and A_Look to avoid recursion @@ -429,7 +429,7 @@ enum ActorFlag8 MF8_STAYONLIFT = 0x02000000, // MBF AI enhancement. MF8_DONTFOLLOWPLAYERS = 0x04000000, // [inkoalawetrust] Friendly monster will not follow players. MF8_SEEFRIENDLYMONSTERS = 0X08000000, // [inkoalawetrust] Hostile monster can see friendly monsters. - MF8_CROSSLINECHECK = 0x10000000, // [MC]Enables CanCrossLine virtual + MF8_CROSSLINECHECK = 0x10000000, // [MC] Enables CanCrossLine virtual MF8_MASTERNOSEE = 0x20000000, // Don't show object in first person if their master is the current camera. MF8_ADDLIGHTLEVEL = 0x40000000, // [MC] Actor light level is additive with sector. MF8_ONLYSLAMSOLID = 0x80000000, // [B] Things with skullfly will ignore non-solid Actors. @@ -438,7 +438,7 @@ enum ActorFlag8 // --- mobj.flags9 --- enum ActorFlag9 { - + MF9_SHADOWAIM = 0x00000001, // [inkoalawetrust] Monster still gets aim penalty from aiming at shadow actors even with MF6_SEEINVISIBLE on. }; // --- mobj.renderflags --- diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 188eb5dfb..95b04ce3b 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -6667,7 +6667,7 @@ AActor *P_SpawnMissileXYZ (DVector3 pos, AActor *source, AActor *dest, PClassAct if (dest == NULL) { - Printf ("P_SpawnMissileXYZ: Tried to shoot %s from %s with no dest\n", + Printf ("P_SpawnMissileXYZ: Tried to shoot %s from %s with no destination\n", type->TypeName.GetChars(), source->GetClass()->TypeName.GetChars()); return NULL; } diff --git a/src/playsim/shadowinlines.h b/src/playsim/shadowinlines.h index 3ff3caf66..0a7144de4 100644 --- a/src/playsim/shadowinlines.h +++ b/src/playsim/shadowinlines.h @@ -26,7 +26,7 @@ extern FRandom pr_crailgun; inline bool CheckShadowFlags(AActor* self, AActor* other) { - return (other->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE)); + return (other->flags & MF_SHADOW && (!(self->flags6 & MF6_SEEINVISIBLE) || self->flags9 & MF9_SHADOWAIM)); } //========================================================================== diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 6ef9fa9cc..aca5cfbc1 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -347,6 +347,8 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(MF8, ADDLIGHTLEVEL, AActor, flags8), DEFINE_FLAG(MF8, ONLYSLAMSOLID, AActor, flags8), + DEFINE_FLAG(MF9, SHADOWAIM, AActor, flags9), + // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects),