mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
fix: guard match simulation after transport shutdown
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user