overhaul bot

This commit is contained in:
2026-01-03 03:40:20 +08:00
parent 7423e29443
commit cbbe95e108
185 changed files with 989 additions and 6514 deletions
+15 -10
View File
@@ -47,17 +47,22 @@ func after_action_completed():
# Clear the highlights after placing the tiles. (Quickfix for Clientside)
clear_highlights()
# Only update UI if this is the LOCAL HUMAN PLAYER
# Bots are owned by the host (authority match) but shouldn't trigger UI updates
if multiplayer.get_unique_id() == player.get_multiplayer_authority():
var main = player.get_tree().get_root().get_node_or_null("Main")
if main:
main.ui_manager.update_button_states()
main.ui_manager.update_playerboard_ui()
# Add this line to sync all boards
main.update_all_players_boards()
# Add sync for playerboard
if player.is_multiplayer_authority():
if not player.is_bot and not player.is_in_group("Bots"):
var main = player.get_tree().get_root().get_node_or_null("Main")
if main:
main.ui_manager.update_button_states()
main.ui_manager.update_playerboard_ui()
# Add this line to sync all boards
main.update_all_players_boards()
# Sync playerboard (Bots DO need to sync their board logic, just not update local UI)
if player.is_multiplayer_authority():
var main = player.get_tree().get_root().get_node_or_null("Main")
if main:
main.rpc("sync_playerboard", player.get_multiplayer_authority(), player.playerboard)
player._is_processing_action = false