- added MF7_NOINFIGHTSPECIES flag.

This commit is contained in:
Christoph Oelckers 2017-02-25 20:12:30 +01:00
parent 5ea8ad54a4
commit 35033891ac
3 changed files with 5 additions and 0 deletions

View file

@ -388,6 +388,7 @@ enum ActorFlag7
MF7_SMASHABLE = 0x04000000, // dies if hitting the floor. MF7_SMASHABLE = 0x04000000, // dies if hitting the floor.
MF7_NOSHIELDREFLECT = 0x08000000, // will not be reflected by shields. 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.
}; };
// --- mobj.renderflags --- // --- mobj.renderflags ---

View file

@ -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) && if ((other->flags3 & MF3_NOTARGET) &&
(other->tid != TIDtoHate || TIDtoHate == 0) && (other->tid != TIDtoHate || TIDtoHate == 0) &&
!IsHostile (other)) !IsHostile (other))

View file

@ -317,6 +317,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF7, SMASHABLE, AActor, flags7), DEFINE_FLAG(MF7, SMASHABLE, AActor, flags7),
DEFINE_FLAG(MF7, NOSHIELDREFLECT, AActor, flags7), DEFINE_FLAG(MF7, NOSHIELDREFLECT, AActor, flags7),
DEFINE_FLAG(MF7, FORCEZERORADIUSDMG, AActor, flags7), DEFINE_FLAG(MF7, FORCEZERORADIUSDMG, AActor, flags7),
DEFINE_FLAG(MF7, NOINFIGHTSPECIES, AActor, flags7),
// Effect flags // Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),