- added DavifPH's fix for poisoning invulnerable players.

SVN r3231 (trunk)
This commit is contained in:
Christoph Oelckers 2011-06-13 10:25:03 +00:00
parent 5d65ab6e6c
commit ab60afd0b8
3 changed files with 21 additions and 0 deletions

View file

@ -328,6 +328,7 @@ enum
MF6_BOSSCUBE = 0x00800000, // Actor spawned by A_BrainSpit, flagged for timefreeze reasons.
MF6_SEEINVISIBLE = 0x01000000, // Monsters can see invisible player.
MF6_DONTCORPSE = 0x02000000, // [RC] Don't autoset MF_CORPSE upon death and don't force Crash state change.
MF6_POISONALWAYS = 0x04000000, // Always apply poison, even when target can't take the damage.
// --- mobj.renderflags ---

View file

@ -1373,6 +1373,25 @@ void P_PoisonMobj (AActor *target, AActor *inflictor, AActor *source, int damage
int olddamage = target->PoisonDamageReceived;
int oldduration = target->PoisonDurationReceived;
// Check for invulnerability.
if (!(inflictor->flags6 & MF6_POISONALWAYS))
{
if (target->flags2 & MF2_INVULNERABLE)
{ // actor is invulnerable
if (target->player == NULL)
{
if (!(inflictor->flags3 & MF3_FOILINVUL))
{
return;
}
}
else
{
return;
}
}
}
target->Poisoner = source;
if (inflictor->flags6 & MF6_ADDITIVEPOISONDAMAGE)

View file

@ -231,6 +231,7 @@ static FFlagDef ActorFlags[]=
DEFINE_FLAG(MF6, NOMENU, AActor, flags6),
DEFINE_FLAG(MF6, SEEINVISIBLE, AActor, flags6),
DEFINE_FLAG(MF6, DONTCORPSE, AActor, flags6),
DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),