- added a FORCEINFIGHTING flag.

This commit is contained in:
Christoph Oelckers 2017-02-26 19:05:20 +01:00
parent 92b916fd5d
commit 0cc46a2aaf
4 changed files with 5 additions and 1 deletions

View file

@ -389,6 +389,7 @@ enum ActorFlag7
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. MF7_NOINFIGHTSPECIES = 0x20000000, // don't start infights with one's own species.
MF7_FORCEINFIGHTING = 0x40000000, // overrides a map setting of 'no infighting'.
}; };
// --- mobj.renderflags --- // --- mobj.renderflags ---

View file

@ -1772,7 +1772,8 @@ bool AActor::OkayToSwitchTarget (AActor *other)
} }
int infight; int infight;
if (flags5 & MF5_NOINFIGHTING) infight=-1; if (flags7 & MF7_FORCEINFIGHTING) infight = 1;
else if (flags5 & MF5_NOINFIGHTING) infight = -1;
else infight = G_SkillProperty(SKILLP_Infight); else infight = G_SkillProperty(SKILLP_Infight);
if (infight < 0 && other->player == NULL && !IsHostile (other)) if (infight < 0 && other->player == NULL && !IsHostile (other))

View file

@ -1177,6 +1177,7 @@ static bool CanAttackHurt(AActor *victim, AActor *shooter)
if (!victim->player && !shooter->player) if (!victim->player && !shooter->player)
{ {
int infight = G_SkillProperty(SKILLP_Infight); int infight = G_SkillProperty(SKILLP_Infight);
if (infight < 0 && (victim->flags7 & MF7_FORCEINFIGHTING)) infight = 0; // This must override the 'no infight' setting to take effect.
if (infight < 0) if (infight < 0)
{ {

View file

@ -318,6 +318,7 @@ static FFlagDef ActorFlagDefs[]=
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), DEFINE_FLAG(MF7, NOINFIGHTSPECIES, AActor, flags7),
DEFINE_FLAG(MF7, FORCEINFIGHTING, AActor, flags7),
// Effect flags // Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),