Skip to content

Fix segfault when setting up view frame for a removed mobj

Hanicef requested to merge Hanicef/SRB2:fix-removed-viewmobj-segfault into next

if a viewmobj used to position the camera is removed, the game could potentially segfault when the view frame is being set up for a frame. this occurs due to a missing P_MobjWasRemoved check inside the frame rendering logic, which is accessed after the mobj has been removed.

this bug most notably happens on Mindscape Zone on Silverhorn, where attempting to skip the initial cutscene with spin will remove the mobj used to position the camera before moving the camera, thus triggering the bug. as always with mobj-related bugs, remember to compile with DEBUGMODE=1 since the bug doesn't trigger consistently otherwise.

Merge request reports