update logic for push
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user