Skip to content
Snippets Groups Projects

Fix segfault when calling P_RemoveMobj from MobjCollide hook

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-mobjcollide-removemobj-segfault into next

When P_RemoveMobj is called from the MobjCollide hook, the game can segfault when bouncing objects hit a wall. This was, as always, caused by missing P_MobjWasRemoved checks around calls to P_TryMove in P_BounceMove. All P_TryMove calls are now followed by checks with P_MobjWasRemoved, and a label was replaced with a do-while for readability reasons.

As always with these bugs, they don't trigger consistently on a release build, so make sure to do a debug build when testing this!

This addon is known to trigger this bug: https://mb.srb2.org/addons/plague-knight.3667/

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
Please register or sign in to reply
Loading