- Exhumed: account for rounding errors in MoveSectorSprites

The formula here left no margin for error and minor rounding errors are inevitable with this code.
This commit is contained in:
Christoph Oelckers 2023-01-07 10:45:15 +01:00
parent cfef8c8a71
commit 2e35d6a6a8

View file

@ -662,7 +662,7 @@ void MoveSectorSprites(sectortype* pSector, double z)
while (auto pActor = it.Next())
{
double actz = pActor->spr.pos.Z;
if ((pActor->spr.statnum != 200 && actz >= minz && actz <= maxz) || pActor->spr.statnum >= 900)
if ((pActor->spr.statnum != 200 && actz > minz - zmaptoworld && actz < maxz + zmaptoworld) || pActor->spr.statnum >= 900)
{
pActor->spr.pos.Z = newz;
}