Skip to content
Snippets Groups Projects

Fix desyncs caused by K_PuntMine

Merged Ashnal requested to merge bird/Kart-Public:mine-punt-sync-fix into next

Fixes desyncs caused by punting a mine while it is being held as a trailing item by another player.

My theory as to why syncbombs occur without this code is as follows: Normally, when a mine is thrown by a player, player->mo->hnext is set to NULL after removing the trailing mine, and creating a a non-shield mine. When someone punted it out of your possession however, the mobj was just P_RemoveMobj'ed and player->mo->hnext is never set to NULL.

I wasn't able to completely track down how hnext is used right after, but based on observation, I think the pointer was being used when it didn't have a valid object, causing undefined behavior. Undefined behavior perfectly explains why the game would sometimes desync, and other times be fine, as different computers could process the undefined behavior in different ways, producing desync.

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