fix: guard match simulation after transport shutdown

This commit is contained in:
Josh Creek
2026-09-01 08:27:56 +01:00
parent c5678ce877
commit afcb01d155
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -192,7 +192,12 @@ func _physics_process(_delta: float) -> void:
var now := Time.get_ticks_msec()
var gap := now - _last_physics_ms
_last_physics_ms = now
if not multiplayer.is_server() or _peer_input_state.is_empty():
# NetworkManager.shutdown() swaps in an OfflineMultiplayerPeer before the
# smoke harness's deferred quit runs. Querying MultiplayerAPI.is_server()
# during that hand-off can call get_unique_id() on an inactive ENet peer and
# emit errors every physics frame; the NetworkManager role flag is the safe
# lifecycle guard at this boundary.
if not NetworkManager.is_server or _peer_input_state.is_empty():
return
if gap < STALL_DETECT_MS:
return