diff --git a/src/playsim/actor.h b/src/playsim/actor.h index 41f57ef28e..f8f0056100 100644 --- a/src/playsim/actor.h +++ b/src/playsim/actor.h @@ -414,6 +414,7 @@ enum ActorFlag8 MF8_ABSVIEWANGLES = 0x00000400, // [MC] By default view angle/pitch/roll is an offset. This will make it absolute instead. MF8_FALLDAMAGE = 0x00000800, // Monster will take fall damage regardless of map settings. MF8_MNOTVISIBLE = 0x00001000, // Actor not visible to monsters + MF8_VISALWAYSFAIL = 0x00002000, // Sight checks to actor always fail MF8_ALLOWTHRUBITS = 0x00008000, // [MC] Enable ThruBits property MF8_FULLVOLSEE = 0x00010000, // Play see sound at full volume MF8_E1M8BOSS = 0x00020000, // MBF21 boss death. diff --git a/src/playsim/p_enemy.cpp b/src/playsim/p_enemy.cpp index 0514f848a4..e85b0687fe 100644 --- a/src/playsim/p_enemy.cpp +++ b/src/playsim/p_enemy.cpp @@ -1252,7 +1252,7 @@ int P_IsVisible(AActor *lookee, AActor *other, INTBOOL allaround, FLookExParams double mindist; DAngle fov; - if (other == nullptr) + if (other == nullptr || (other->flags8 & MF8_VISALWAYSFAIL)) { return false; } diff --git a/src/playsim/p_sight.cpp b/src/playsim/p_sight.cpp index 588bbec81a..caa5c0f066 100644 --- a/src/playsim/p_sight.cpp +++ b/src/playsim/p_sight.cpp @@ -849,6 +849,11 @@ int P_CheckSight (AActor *t1, AActor *t2, int flags) return false; } + if (t2->flags8 & MF8_VISALWAYSFAIL) + { + return false; + } + auto s1 = t1->Sector; auto s2 = t2->Sector; // diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index f04738b249..a276cb2bd0 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -327,6 +327,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(MF8, STOPRAILS, AActor, flags8), DEFINE_FLAG(MF8, FALLDAMAGE, AActor, flags8), DEFINE_FLAG(MF8, MNOTVISIBLE, AActor, flags8), + DEFINE_FLAG(MF8, VISALWAYSFAIL, AActor, flags8), DEFINE_FLAG(MF8, ABSVIEWANGLES, AActor, flags8), DEFINE_FLAG(MF8, ALLOWTHRUBITS, AActor, flags8), DEFINE_FLAG(MF8, FULLVOLSEE, AActor, flags8),