Fix for E1L1 dumpster fire issue

git-svn-id: https://svn.eduke32.com/eduke32@8636 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2020-02-11 09:21:40 +00:00 committed by Christoph Oelckers
parent 5a13be1f7b
commit 46b62aa6aa

View file

@ -416,6 +416,7 @@ void A_GetZLimits(int const spriteNum)
auto const pSprite = &sprite[spriteNum]; auto const pSprite = &sprite[spriteNum];
int32_t ceilhit, florhit; int32_t ceilhit, florhit;
int const clipDist = A_GetClipdist(spriteNum, -1); int const clipDist = A_GetClipdist(spriteNum, -1);
auto const oceilz = actor[spriteNum].ceilingz;
VM_GetZRange(spriteNum, &ceilhit, &florhit, pSprite->statnum == STAT_PROJECTILE ? clipDist << 3 : clipDist); VM_GetZRange(spriteNum, &ceilhit, &florhit, pSprite->statnum == STAT_PROJECTILE ? clipDist << 3 : clipDist);
actor[spriteNum].flags &= ~SFLAG_NOFLOORSHADOW; actor[spriteNum].flags &= ~SFLAG_NOFLOORSHADOW;
@ -440,6 +441,15 @@ void A_GetZLimits(int const spriteNum)
actor[spriteNum].floorz = sector[pSprite->sectnum].floorz; actor[spriteNum].floorz = sector[pSprite->sectnum].floorz;
} }
} }
// in E1L1, the dumpster fire sprites break after calling this function because the cardboard boxes
// are a few units higher than the fire and are detected as the "ceiling"
// unfortunately, this trips the "ifgapzl 16 break" in "state firestate"
if ((ceilhit&49152) == 49152 && (sprite[ceilhit&(MAXSPRITES-1)].cstat&48) == 0)
{
if (pSprite->z >= actor[spriteNum].floorz)
actor[spriteNum].ceilingz = oceilz;
}
} }
void A_Fall(int const spriteNum) void A_Fall(int const spriteNum)