PCExhumed: Don't modify coordinates with abs() in runlist_CheckRadialDamage(), correct to original behaviour.

This commit is contained in:
sirlemonhead 2020-02-28 10:17:02 +00:00 committed by Christoph Oelckers
parent 3855eb889e
commit 69aba5f3ea

View file

@ -1577,21 +1577,15 @@ int runlist_CheckRadialDamage(short nSprite)
int y = (sprite[nSprite].y - sprite[nRadialSpr].y) >> 8; int y = (sprite[nSprite].y - sprite[nRadialSpr].y) >> 8;
int z = (sprite[nSprite].z - sprite[nRadialSpr].z) >> 12; int z = (sprite[nSprite].z - sprite[nRadialSpr].z) >> 12;
x = klabs(x); if (klabs(x) > nDamageRadius) {
if (x > nDamageRadius) {
return 0; return 0;
} }
y = klabs(y); if (klabs(y) > nDamageRadius) {
if (y > nDamageRadius) {
return 0; return 0;
} }
z = klabs(z); if (klabs(z) > nDamageRadius) {
if (z > nDamageRadius) {
return 0; return 0;
} }
@ -1622,6 +1616,7 @@ int runlist_CheckRadialDamage(short nSprite)
else if (edi > 20) else if (edi > 20)
{ {
int nAngle = GetMyAngle(x, y); int nAngle = GetMyAngle(x, y);
sprite[nSprite].xvel += (edi * Cos(nAngle)) >> 3; sprite[nSprite].xvel += (edi * Cos(nAngle)) >> 3;
sprite[nSprite].yvel += (edi * Sin(nAngle)) >> 3; sprite[nSprite].yvel += (edi * Sin(nAngle)) >> 3;
sprite[nSprite].zvel -= edi * 24; sprite[nSprite].zvel -= edi * 24;