- 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 860bd19738
commit bf3319d5ec

View file

@ -662,7 +662,7 @@ void MoveSectorSprites(sectortype* pSector, double z)
while (auto pActor = it.Next()) while (auto pActor = it.Next())
{ {
double actz = pActor->spr.pos.Z; 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; pActor->spr.pos.Z = newz;
} }