- fixed: Checks for poison damage were not correct.

SVN r2469 (trunk)
This commit is contained in:
Christoph Oelckers 2010-07-29 06:53:20 +00:00
parent e1f06da5e3
commit 30ffffd904

View file

@ -1090,7 +1090,7 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
S_Sound (tm.thing, CHAN_BODY, "misc/ripslop", 1, ATTN_IDLE);
// Do poisoning (if using new style poison)
if (tm.thing->PoisonDuration != INT_MIN)
if (tm.thing->PoisonDamage > 0 && tm.thing->PoisonDuration != INT_MIN)
{
P_PoisonMobj(thing, tm.thing, tm.thing->target, tm.thing->PoisonDamage, tm.thing->PoisonDuration, tm.thing->PoisonPeriod);
}
@ -1118,7 +1118,7 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
}
// Do poisoning (if using new style poison)
if (tm.thing->PoisonDuration != INT_MIN)
if (tm.thing->PoisonDamage > 0 && tm.thing->PoisonDuration != INT_MIN)
{
P_PoisonMobj(thing, tm.thing, tm.thing->target, tm.thing->PoisonDamage, tm.thing->PoisonDuration, tm.thing->PoisonPeriod);
}
@ -3487,7 +3487,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
}
// Allow puffs to inflict poison damage, so that hitscans can poison, too.
if (puffDefaults->PoisonDuration != INT_MIN)
if (puffDefaults->PoisonDamage > 0 && puffDefaults->PoisonDuration != INT_MIN)
{
P_PoisonMobj(trace.Actor, puff ? puff : t1, t1, puffDefaults->PoisonDamage, puffDefaults->PoisonDuration, puffDefaults->PoisonPeriod);
}
@ -3862,7 +3862,7 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color
}
if (spawnpuff) P_SpawnPuff (source, puffclass, x, y, z, (source->angle + angleoffset) - ANG90, 1, PF_HITTHING);
if (puffDefaults && puffDefaults->PoisonDuration != INT_MIN)
if (puffDefaults && puffDefaults->PoisonDamage > 0 && puffDefaults->PoisonDuration != INT_MIN)
P_PoisonMobj(RailHits[i].HitActor, thepuff ? thepuff : source, source, puffDefaults->PoisonDamage, puffDefaults->PoisonDuration, puffDefaults->PoisonPeriod);
P_DamageMobj (RailHits[i].HitActor, thepuff? thepuff:source, source, damage, damagetype, DMG_INFLICTOR_IS_PUFF);