From 7b0a7530785238f2c0da314241fd65c61be85153 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Tue, 12 Mar 2024 11:35:15 +0100 Subject: [PATCH] fix room crashing bug --- content/main.tscn | 2 +- content/system/house/room/room.gd | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/content/main.tscn b/content/main.tscn index 1fe7a43..3ef5a93 100644 --- a/content/main.tscn +++ b/content/main.tscn @@ -47,7 +47,7 @@ shadow_enabled = true [node name="XROrigin3D" type="XROrigin3D" parent="."] [node name="XRCamera3D" type="XRCamera3D" parent="XROrigin3D"] -transform = Transform3D(0.999992, 0.00357422, -0.00141238, -0.00357241, 0.999993, 0.00127761, 0.00141693, -0.00127253, 0.999998, 0.0356617, 0.71033, 0.00564247) +transform = Transform3D(0.999999, 0.00106283, -0.000420545, -0.00106267, 0.999999, 0.000379457, 0.000420948, -0.000378989, 1, 0.0356617, 0.71033, 0.00564247) cull_mask = 524287 current = true diff --git a/content/system/house/room/room.gd b/content/system/house/room/room.gd index ec9e131..6ccc18c 100644 --- a/content/system/house/room/room.gd +++ b/content/system/house/room/room.gd @@ -26,6 +26,9 @@ func has_point(point: Vector3) -> bool: func get_aabb(): var room_store = Store.house.get_room(name) + if room_store == null: + return AABB() + var corners = room_store.corners if corners.size() == 0: @@ -119,4 +122,3 @@ static func generate_ceiling_mesh(room_store: Dictionary): var mesh = st.commit() return mesh -