update logic for push

This commit is contained in:
2026-01-23 08:38:45 +08:00
parent c1ba5d1888
commit 89a3beb2b2
145 changed files with 1530 additions and 1447 deletions
+17
View File
@@ -721,6 +721,23 @@ func get_occupied_positions() -> Array:
occupied.append(player.current_position)
return occupied
# Helper to find which player is at a specific position
func get_player_at_position(pos: Vector2i) -> Node3D:
for player in get_tree().get_nodes_in_group("Players"):
if player == self:
continue
# Check current position
if player.current_position == pos:
return player
# Check target position if moving
if player.is_player_moving and player.target_position == pos:
return player
return null
# Modify the select_spawn_point function to notify other clients
func select_spawn_point(spawn_pos: Vector2i) -> bool:
if not is_multiplayer_authority() or is_bot or spawn_point_selected: