mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Take slope heights into account in A_RadiusDamage()
git-svn-id: https://svn.eduke32.com/eduke32@8101 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0cba9d2036
commit
48ca8f01aa
1 changed files with 7 additions and 5 deletions
|
@ -268,25 +268,27 @@ void A_RadiusDamage(int const spriteNum, int const blastRadius, int const dmg1,
|
|||
{
|
||||
int const sectorNum = sectorList[sectorCount++];
|
||||
auto const &listSector = sector[sectorNum];
|
||||
vec2_t closest;
|
||||
|
||||
if (getsectordist(pSprite->pos.vec2, sectorNum) >= blastRadius)
|
||||
if (getsectordist(pSprite->pos.vec2, sectorNum, &closest) >= blastRadius)
|
||||
continue;
|
||||
|
||||
int const startWall = listSector.wallptr;
|
||||
int const endWall = listSector.wallnum + startWall;
|
||||
|
||||
if (((listSector.ceilingz - pSprite->z) >> 8) < blastRadius)
|
||||
int32_t floorZ, ceilZ;
|
||||
getzsofslope(sectorNum, closest.x, closest.y, &ceilZ, &floorZ);
|
||||
|
||||
if (((ceilZ - pSprite->z) >> 8) < blastRadius)
|
||||
Sect_DamageCeiling_Internal(spriteNum, sectorNum);
|
||||
|
||||
if (((pSprite->z - listSector.floorz) >> 8) < blastRadius)
|
||||
if (((pSprite->z - floorZ) >> 8) < blastRadius)
|
||||
Sect_DamageFloor_Internal(spriteNum, sectorNum);
|
||||
|
||||
int w = startWall;
|
||||
|
||||
for (auto pWall = (uwallptr_t)&wall[startWall]; w < endWall; ++w, ++pWall)
|
||||
{
|
||||
vec2_t closest;
|
||||
|
||||
if (getwalldist(pSprite->pos.vec2, w, &closest) >= blastRadius)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in a new issue