Fixed a crash on building destruction

This commit is contained in:
Melvin Weiß 2025-10-22 13:09:12 +02:00
parent b4dbd50a8f
commit b2aa7b2907
2 changed files with 3 additions and 1 deletions

View file

@ -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"]

View file

@ -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)