From a7b359f8bea6f11f79b78a0aee713d5414da60d3 Mon Sep 17 00:00:00 2001 From: 2ManyProjects Date: Wed, 26 Feb 2025 22:52:08 -0600 Subject: [PATCH] fixed bug where piece isnt being removed from old poretal --- Systems/Tiles/Portal.gd | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Systems/Tiles/Portal.gd b/Systems/Tiles/Portal.gd index a0f2347..05e8f0f 100644 --- a/Systems/Tiles/Portal.gd +++ b/Systems/Tiles/Portal.gd @@ -69,10 +69,6 @@ func animate_portal_teleport(piece: Pawn, origin_container: PieceContainer, dest step2_tween.parallel().tween_property(piece, "modulate", fade_color, 0.3) await step2_tween.finished - # Step 3: Reparent to destination container - # origin_container.remove_child(piece) - # destination_container.add_child(piece) - # Position at target portal center var target_portal_center = other_portal.base_button.global_position + (other_portal.base_button.size / 2) piece.global_position = target_portal_center @@ -90,6 +86,12 @@ func animate_portal_teleport(piece: Pawn, origin_container: PieceContainer, dest # Reset z-index piece.z_index = original_z_index + # Step 3: Reparent to destination container + # origin_container.remove_child(piece) + # destination_container.add_child(piece) + destination_container.set_piece(piece, false) + origin_container.remove_piece(true) + func update_appearance() -> void: if is_effect_active() && base_button: var style = StyleBoxFlat.new()