Skip to content
Snippets Groups Projects

Fix segfault when trying to spawn an MT_PLAYER from Lua

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-segfault-player-spawnmobj into next

when trying to spawn an MT_PLAYER using P_SpawnMobj or P_SpawnMobjFromMobj, the game would segfault due to a missing parameter for that specific type. this is a special case that exists to prevent Lua from removing a player mobj before it has gotten assigned it's corresponding player, which used to cause segfaults in prior versions. however, that parameter was not passed when being called from Lua, and will thus segfault when trying to spawn an MT_PLAYER. the fix simply works by passing NULL for that special parameter, which will set the player field on the mobj to NULL instead of an undefined address.

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