- SW: Add nullptr check inside ActorTrackDecide() for walltype's nextSector() to prevent crashes while noclipping through level.

This commit is contained in:
Mitch Richters 2021-12-05 17:21:28 +11:00 committed by Christoph Oelckers
parent 5085dcd866
commit 10e28b8a53

View file

@ -3140,6 +3140,9 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor)
if (hit.hitWall == nullptr) if (hit.hitWall == nullptr)
return false; return false;
if (hit.hitWall->nextSector() == nullptr)
return false;
zdiff = labs(sp->z - hit.hitWall->nextSector()->floorz) >> 8; zdiff = labs(sp->z - hit.hitWall->nextSector()->floorz) >> 8;
u->jump_speed = PickJumpSpeed(actor, zdiff); u->jump_speed = PickJumpSpeed(actor, zdiff);