- Exhumed: Restore original tangent-based slope tilting code.

* Pitch-based version just doesn't work, and hasn't since it was changed to pitch before the fixedhoriz > DAngle changeover.
This commit is contained in:
Mitchell Richters 2022-09-30 20:05:38 +10:00 committed by Christoph Oelckers
parent 355860f662
commit d15e1017bd

View file

@ -2500,10 +2500,9 @@ sectdone:
if (cl_slopetilting && !pPlayer->bPlayerPan && !pPlayer->bLockPan)
{
double nVertPan = (pPlayer->nDestVertPan - pPlayer->horizon.horiz).Degrees();
if (nVertPan != 0)
if (double nVertPan = deltaangle(pPlayer->horizon.horiz, pPlayer->nDestVertPan).Tan() * 32.)
{
pPlayer->horizon.addadjustment(DAngle::fromDeg(abs(nVertPan) >= 1.79 ? clamp(nVertPan, -1.79, 1.79) : nVertPan * 2.));
pPlayer->horizon.addadjustment(maphoriz(abs(nVertPan) >= 4 ? clamp(nVertPan, -4., 4.) : nVertPan * 2.));
}
}
}