From 35033891ace78be7dc4623cfbe3e51960830a5fc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 20:12:30 +0100 Subject: [PATCH] - added MF7_NOINFIGHTSPECIES flag. --- src/actor.h | 1 + src/p_interaction.cpp | 3 +++ src/scripting/thingdef_data.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/src/actor.h b/src/actor.h index d387da2c88..c8c7cbc5ff 100644 --- a/src/actor.h +++ b/src/actor.h @@ -388,6 +388,7 @@ enum ActorFlag7 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_NOINFIGHTSPECIES = 0x20000000, // don't start infights with one's own species. }; // --- mobj.renderflags --- diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 28df6e761f..e940c259f8 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1714,6 +1714,9 @@ bool AActor::OkayToSwitchTarget (AActor *other) } } + if ((flags7 & MF7_NOINFIGHTSPECIES) && GetSpecies() == target->GetSpecies()) + return false; // Don't fight own species. + if ((other->flags3 & MF3_NOTARGET) && (other->tid != TIDtoHate || TIDtoHate == 0) && !IsHostile (other)) diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 735fddba78..a737ce4143 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -317,6 +317,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(MF7, SMASHABLE, AActor, flags7), DEFINE_FLAG(MF7, NOSHIELDREFLECT, AActor, flags7), DEFINE_FLAG(MF7, FORCEZERORADIUSDMG, AActor, flags7), + DEFINE_FLAG(MF7, NOINFIGHTSPECIES, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),