From 6db6465d1b938ec494cd66c9984bff5cc14bde11 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 20 Oct 2024 12:09:48 +0200 Subject: next commit --- Game/Network.gd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Game/Network.gd') diff --git a/Game/Network.gd b/Game/Network.gd index 5a435b7..be5bb20 100644 --- a/Game/Network.gd +++ b/Game/Network.gd @@ -114,10 +114,11 @@ func update_player(id: int, remote_data: Dictionary): @rpc("any_peer") #func destroy_tower(remote_tower: Dictionary): -func destroy_tower(position: Vector2): - var owner_id = multiplayer.get_remote_sender_id() - var player = get_player(owner_id) - var tower = player.towers.get(position) +func destroy_tower(remote_data: Dictionary): + var data: Tower.NetworkData = dict_to_inst(remote_data) + var remote_tower = Tower.from_network_data(data) + var player = get_player(remote_tower.owner_id) + var tower = player.towers.get(remote_tower.global_position) Client.current_stage.destroy_tower(tower) -- cgit v1.2.3