Skip to content

Fix desynch when a player spawns

LJ Sonic requested to merge fix-spawn-desynch into next

This fixes a common, longstanding bug where a player spawning/respawning can randomly desynch the game.

This issue was caused by a nasty hack, however simply removing that hack was not enough, as it was added to prevent an inconvenient glitch where players would spawn in the wrong direction depending on their input lag.

In order to fix that properly, I made angleturn a relative value when sending packets, and turning it back into an absolute value before running the gamelogic. That way, gamelogic events (spawning, hitting a spring, etc), which cannot be predicted at time of calling G_BuildTicCmd, can change the player's angle without any delay caused by latency.

Merge request reports