Skip to content
Snippets Groups Projects

Fix segfault when trying to access mo->player->mo from SpawnMobj hook

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-nil-mo-spawnmobj-hook into next

Due to a symmetry flaw in the MobjSpawn hook, accessing mo->player->mo when an MT_PLAYER is spawning will cause the game to segfault. This was caused by the spawn logic not setting mobj->player->mo when setting mobj->player, thus causing mobj->player->mo to remain NULL when SpawnHook was invoked. The fix sets both values at the same time, thus fixing the issue.

Fixes #1189 (closed)

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
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading