mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 00:21:43 +00:00
- fixed FORCEPAIN logic.
SVN r1650 (trunk)
This commit is contained in:
parent
28378a50aa
commit
16bf1ef6d0
3 changed files with 26 additions and 17 deletions
|
@ -1,4 +1,5 @@
|
||||||
June 7, 2009 (Changes by Graf Zahl)
|
June 7, 2009 (Changes by Graf Zahl)
|
||||||
|
- fixed FORCEPAIN logic.
|
||||||
- added Gez's infinite ammo powerup and random spawner fix patches.
|
- added Gez's infinite ammo powerup and random spawner fix patches.
|
||||||
- reduced size of Hexen's flames to fix bug in Deathkings MAP01.
|
- reduced size of Hexen's flames to fix bug in Deathkings MAP01.
|
||||||
- added checks for sidedef scaling values
|
- added checks for sidedef scaling values
|
||||||
|
|
|
@ -878,6 +878,9 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
||||||
player_t *player = NULL;
|
player_t *player = NULL;
|
||||||
fixed_t thrust;
|
fixed_t thrust;
|
||||||
int temp;
|
int temp;
|
||||||
|
int painchance = 0;
|
||||||
|
FState * woundstate = NULL;
|
||||||
|
PainChanceList * pc = NULL;
|
||||||
|
|
||||||
if (target == NULL || !(target->flags & MF_SHOOTABLE))
|
if (target == NULL || !(target->flags & MF_SHOOTABLE))
|
||||||
{ // Shouldn't happen
|
{ // Shouldn't happen
|
||||||
|
@ -1233,7 +1236,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FState * woundstate = target->FindState(NAME_Wound, mod);
|
woundstate = target->FindState(NAME_Wound, mod);
|
||||||
if (woundstate != NULL)
|
if (woundstate != NULL)
|
||||||
{
|
{
|
||||||
int woundhealth = RUNTIME_TYPE(target)->Meta.GetMetaInt (AMETA_WoundHealth, 6);
|
int woundhealth = RUNTIME_TYPE(target)->Meta.GetMetaInt (AMETA_WoundHealth, 6);
|
||||||
|
@ -1245,8 +1248,8 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PainChanceList * pc = target->GetClass()->ActorInfo->PainChances;
|
pc = target->GetClass()->ActorInfo->PainChances;
|
||||||
int painchance = target->PainChance;
|
painchance = target->PainChance;
|
||||||
if (pc != NULL)
|
if (pc != NULL)
|
||||||
{
|
{
|
||||||
BYTE * ppc = pc->CheckKey(mod);
|
BYTE * ppc = pc->CheckKey(mod);
|
||||||
|
|
|
@ -1011,21 +1011,25 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
|
||||||
}
|
}
|
||||||
// Do damage
|
// Do damage
|
||||||
damage = tm.thing->GetMissileDamage ((tm.thing->flags4 & MF4_STRIFEDAMAGE) ? 3 : 7, 1);
|
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);
|
P_DamageMobj (thing, tm.thing, tm.thing->target, damage, tm.thing->DamageType);
|
||||||
if ((tm.thing->flags5 & MF5_BLOODSPLATTER) &&
|
if (damage > 0)
|
||||||
!(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->flags5 & MF5_BLOODSPLATTER) &&
|
||||||
}
|
!(thing->flags & MF_NOBLOOD) &&
|
||||||
if (!(tm.thing->flags3 & MF3_BLOODLESSIMPACT))
|
!(thing->flags2 & MF2_REFLECTIVE) &&
|
||||||
{
|
!(thing->flags2 & (MF2_INVULNERABLE|MF2_DORMANT)) &&
|
||||||
P_TraceBleed (damage, thing, tm.thing);
|
!(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)
|
else if (damage < 0)
|
||||||
|
@ -3239,7 +3243,8 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
|
||||||
trace.Actor, srcangle, srcpitch);
|
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;
|
int flags = DMG_INFLICTOR_IS_PUFF;
|
||||||
// Allow MF5_PIERCEARMOR on a weapon as well.
|
// Allow MF5_PIERCEARMOR on a weapon as well.
|
||||||
|
|
Loading…
Reference in a new issue