Fix client calling place_order multiple times

This commit is contained in:
JonShard
2026-08-17 15:28:13 +02:00
parent 4f9e22f0b9
commit d895bc0a47
2 changed files with 5 additions and 11 deletions
+2 -8
View File
@@ -208,6 +208,8 @@ func _on_object_dropped(_item) -> void:
func _on_player_enter(_body):
_players_count += 1
SweetLogger.debug("Player enter, players_count: {0}", [_players_count])
if _is_leader and _state == TableState.ORDERING:
place_order()
func _on_player_exit(_body):
@@ -215,13 +217,6 @@ func _on_player_exit(_body):
SweetLogger.debug("Player exit, players_count: {0}", [_players_count])
func _place_order_if_player():
if _state != TableState.ORDERING:
return
if _players_count > 0:
place_order()
func _get_plate_controller_from_item(_item: Node) -> PlateController:
if not _item:
SweetLogger.debug("Item is null")
@@ -418,7 +413,6 @@ func _process(delta: float) -> void:
_refresh_display()
if not _is_leader:
return # Follower: the group leader orchestrates the FSM, we just mirror its synced state.
_place_order_if_player()
if not NetworkManager.owns_world():
# SweetLogger.debug("Not server, skipping state update")