From b2aa7b290721957ff0f273e31d93f962c9189071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melvin=20Wei=C3=9F?= Date: Wed, 22 Oct 2025 13:09:12 +0200 Subject: [PATCH] Fixed a crash on building destruction --- main.tscn | 2 ++ world/grid.gd | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.tscn b/main.tscn index 34436e3..5e6e275 100644 --- a/main.tscn +++ b/main.tscn @@ -104,6 +104,8 @@ colors = Array[Color]([Color(0, 0.6441987, 0.6693053, 1), Color(0.90588236, 0.15 script = ExtResource("10_efxa6") boss = ExtResource("11_efxa6") +[node name="Boss" parent="." instance=ExtResource("11_efxa6")] + [connection signal="active_item_changed" from="Player" to="UIOverlay/ItemUI" method="_on_player_active_item_changed"] [connection signal="health_changed" from="Player" to="UIOverlay/Healthbar" method="_on_player_health_changed"] [connection signal="max_hp_changed" from="Player" to="UIOverlay/Healthbar" method="_on_player_max_hp_changed"] diff --git a/world/grid.gd b/world/grid.gd index 471c675..51a50e5 100644 --- a/world/grid.gd +++ b/world/grid.gd @@ -56,7 +56,7 @@ func place_object_list(obj_list : Node2D, building): # The building remembers these objects: If it is destroyed, so are they. if object is Platform or object is Trap or object is Item: building.objects.append(object) - if "building" in object: object.building = self + if "building" in object: object.building = building # This scales platforms hoizontally to make sure they still form a floor without gaps. if(object.has_method("init_at_horizontal_distortion")): object.init_at_horizontal_distortion(object.position.length() / Grid.ground_radius)