feat: update candy logic

This commit is contained in:
2026-07-07 18:08:49 +08:00
parent 04e40f5b76
commit 286d0ce069
5 changed files with 26 additions and 26 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ func handle_unhandled_input(event):
if event.is_action_pressed("action_knock_tekton"):
if LobbyManager.game_mode == "Candy Survival":
var gm = player.get_node_or_null("/root/Main/CandySurvivalManager")
if gm and gm.is_active:
if gm and gm.active:
# Find a target to knock (first adjacent player)
var p_pos = player.current_position
var all_players = get_tree().get_nodes_in_group("Players")
@@ -130,7 +130,7 @@ func handle_unhandled_input(event):
elif event.is_action_pressed("action_grab_tekton"):
if LobbyManager.game_mode == "Candy Survival":
var gm = player.get_node_or_null("/root/Main/CandySurvivalManager")
if gm and gm.is_active:
if gm and gm.active:
var pid = player.get("peer_id") if "peer_id" in player else player.name.to_int()
if multiplayer.is_server():
gm.try_activate_ghost(pid)