mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 05:01:41 +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)
|
||||
- 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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue