- fixed FORCEPAIN logic.

SVN r1650 (trunk)
This commit is contained in:
Christoph Oelckers 2009-06-07 17:04:40 +00:00
parent 28378a50aa
commit 16bf1ef6d0
3 changed files with 26 additions and 17 deletions

View file

@ -1,4 +1,5 @@
June 7, 2009 (Changes by Graf Zahl)
- fixed FORCEPAIN logic.
- added Gez's infinite ammo powerup and random spawner fix patches.
- reduced size of Hexen's flames to fix bug in Deathkings MAP01.
- added checks for sidedef scaling values

View file

@ -878,6 +878,9 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
player_t *player = NULL;
fixed_t thrust;
int temp;
int painchance = 0;
FState * woundstate = NULL;
PainChanceList * pc = NULL;
if (target == NULL || !(target->flags & MF_SHOOTABLE))
{ // Shouldn't happen
@ -1233,7 +1236,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
return;
}
FState * woundstate = target->FindState(NAME_Wound, mod);
woundstate = target->FindState(NAME_Wound, mod);
if (woundstate != NULL)
{
int woundhealth = RUNTIME_TYPE(target)->Meta.GetMetaInt (AMETA_WoundHealth, 6);
@ -1244,9 +1247,9 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
return;
}
}
PainChanceList * pc = target->GetClass()->ActorInfo->PainChances;
int painchance = target->PainChance;
pc = target->GetClass()->ActorInfo->PainChances;
painchance = target->PainChance;
if (pc != NULL)
{
BYTE * ppc = pc->CheckKey(mod);

View file

@ -1011,21 +1011,25 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
}
// Do damage
damage = tm.thing->GetMissileDamage ((tm.thing->flags4 & MF4_STRIFEDAMAGE) ? 3 : 7, 1);
if (damage > 0)
// [GZ] If MF6_FORCEPAIN is set, we need to call P_DamageMobj even if damage is 0!
if ((damage > 0) || (tm.thing->flags6 & MF6_FORCEPAIN))
{
P_DamageMobj (thing, tm.thing, tm.thing->target, damage, tm.thing->DamageType);
if ((tm.thing->flags5 & MF5_BLOODSPLATTER) &&
!(thing->flags & MF_NOBLOOD) &&
!(thing->flags2 & MF2_REFLECTIVE) &&
!(thing->flags2 & (MF2_INVULNERABLE|MF2_DORMANT)) &&
!(tm.thing->flags3 & MF3_BLOODLESSIMPACT) &&
(pr_checkthing() < 192))
if (damage > 0)
{
P_BloodSplatter (tm.thing->x, tm.thing->y, tm.thing->z, thing);
}
if (!(tm.thing->flags3 & MF3_BLOODLESSIMPACT))
{
P_TraceBleed (damage, thing, tm.thing);
if ((tm.thing->flags5 & MF5_BLOODSPLATTER) &&
!(thing->flags & MF_NOBLOOD) &&
!(thing->flags2 & MF2_REFLECTIVE) &&
!(thing->flags2 & (MF2_INVULNERABLE|MF2_DORMANT)) &&
!(tm.thing->flags3 & MF3_BLOODLESSIMPACT) &&
(pr_checkthing() < 192))
{
P_BloodSplatter (tm.thing->x, tm.thing->y, tm.thing->z, thing);
}
if (!(tm.thing->flags3 & MF3_BLOODLESSIMPACT))
{
P_TraceBleed (damage, thing, tm.thing);
}
}
}
else if (damage < 0)
@ -3239,7 +3243,8 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
trace.Actor, srcangle, srcpitch);
}
}
if (damage)
// [GZ] If MF6_FORCEPAIN is set, we need to call P_DamageMobj even if damage is 0!
if (damage || puff->flags6 & MF6_FORCEPAIN)
{
int flags = DMG_INFLICTOR_IS_PUFF;
// Allow MF5_PIERCEARMOR on a weapon as well.