- Duke: Change clamping of ceilz/floorz in draw code.

* Also repair potential bug between actor's cz/fz vs. player's truecz/truecz introduced in "- Duke: Floatify `displayrooms()` and flatten smoothratio back out to float.".
This commit is contained in:
Mitchell Richters 2022-09-20 10:36:32 +10:00 committed by Christoph Oelckers
parent ecd880ad6c
commit 2c6435377a

View file

@ -364,13 +364,13 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
else if (p->spritebridge == 0 && p->newOwner == nullptr)
{
cpos.Z = clamp(cpos.Z, cz + 4, fz - 4);
cpos.Z = min(max(cpos.Z, p->truecz + 4), p->truefz - 4);
}
if (sect)
{
getzsofslopeptr(sect, cpos, &cz, &fz);
cpos.Z = clamp(cpos.Z, cz + 4, fz - 4);
cpos.Z = min(max(cpos.Z, cz + 4), fz - 4);
}
choriz = clamp(choriz, q16horiz(gi->playerHorizMin()), q16horiz(gi->playerHorizMax()));