mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- use vector math for distances in actRadiusDamage
This commit is contained in:
parent
9460239417
commit
12d54a8b5c
1 changed files with 2 additions and 7 deletions
|
@ -2658,10 +2658,7 @@ void actRadiusDamage(DBloodActor* source, const DVector3& pos, sectortype* pSect
|
|||
if (!CheckSector(sectorMap, act2)) continue;
|
||||
if (!CheckProximity(act2, x, y, z, pSector, nDist)) continue;
|
||||
|
||||
int dx = abs(x - act2->int_pos().X);
|
||||
int dy = abs(y - act2->int_pos().Y);
|
||||
int dz = abs(z - act2->int_pos().Z) >> 4;
|
||||
int dist = ksqrt(dx * dx + dy * dy + dz * dz);
|
||||
int dist = int((pos - act2->spr.pos).Length() * worldtoint);
|
||||
if (dist > nDist) continue;
|
||||
|
||||
int totaldmg;
|
||||
|
@ -2685,9 +2682,7 @@ void actRadiusDamage(DBloodActor* source, const DVector3& pos, sectortype* pSect
|
|||
|
||||
if (act2->xspr.locked) continue;
|
||||
|
||||
int dx = abs(x - act2->int_pos().X);
|
||||
int dy = abs(y - act2->int_pos().Y);
|
||||
int dist = ksqrt(dx * dx + dy * dy);
|
||||
int dist = int((pos.XY() - act2->spr.pos.XY()).Length() * worldtoint);
|
||||
if (dist > nDist) continue;
|
||||
|
||||
int totaldmg;
|
||||
|
|
Loading…
Reference in a new issue