- fixed: Draining health from a victim must check for damage reduction before awarding the health to the player. This affected Heretic's gauntlets, A_Saw and A_CustomPunch.

- added a DONTDRAIN flag that prevents the above attacks from draining any health at all.
This commit is contained in:
Christoph Oelckers 2013-06-24 16:42:43 +02:00
commit 394f21f71e
8 changed files with 27 additions and 15 deletions

View file

@ -1388,6 +1388,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
angle_t angle;
int pitch;
AActor * linetarget;
int actualdamage;
if (!norandom) Damage *= (pr_cwpunch()%8+1);
@ -1404,13 +1405,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
if (!PuffType) PuffType = PClass::FindClass(NAME_BulletPuff);
int puffFlags = LAF_ISMELEEATTACK | (flags & CPF_NORANDOMPUFFZ)? LAF_NORANDOMPUFFZ : 0;
P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget);
P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget, &actualdamage);
// turn to face target
if (linetarget)
{
if (LifeSteal)
P_GiveBody (self, (Damage * LifeSteal) >> FRACBITS);
if (LifeSteal && !(linetarget->flags5 & MF5_DONTDRAIN))
P_GiveBody (self, (actualdamage * LifeSteal) >> FRACBITS);
if (weapon != NULL)
{