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:
terminx 2019-09-17 03:20:08 +00:00 committed by Christoph Oelckers
parent 0cba9d2036
commit 48ca8f01aa

View file

@ -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;