- SW: Add nullptr check inside DoPlayerHorizon() for canslopetilt to prevent crashes while noclipping through level.

This commit is contained in:
Mitch Richters 2021-12-05 17:15:49 +11:00 committed by Christoph Oelckers
parent e223466f4a
commit 5085dcd866

View file

@ -1610,7 +1610,7 @@ void SlipSlope(PLAYERp pp)
void DoPlayerHorizon(PLAYERp pp, float const horz, double const scaleAdjust)
{
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && TEST(pp->cursector->floorstat, FLOOR_STAT_SLOPE);
bool const canslopetilt = !TEST(pp->Flags, PF_FLYING|PF_SWIMMING|PF_DIVING|PF_CLIMBING|PF_JUMPING|PF_FALLING) && pp->cursector && TEST(pp->cursector->floorstat, FLOOR_STAT_SLOPE);
pp->horizon.calcviewpitch(pp->pos.vec2, pp->angle.ang, pp->input.actions & SB_AIMMODE, canslopetilt, pp->cursector, scaleAdjust, TEST(pp->Flags, PF_CLIMBING));
pp->horizon.applyinput(horz, &pp->input.actions, scaleAdjust);
}