summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2021-10-29 13:38:00 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2021-10-29 14:25:49 +0300
commite058cf93bdab407a5fdce508f9abe21414ffc44f (patch)
treee899156beb1cfdc461799bf4c2817b4c113b470d
parent75baf16bab073fb52fb0ec33f08517cfb3febaa1 (diff)
Fix crashing of `FogVolume`s when `WorldEnvironment` was added
-rw-r--r--scene/3d/fog_volume.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/3d/fog_volume.cpp b/scene/3d/fog_volume.cpp
index 35bcfb4f2c..cc4fbbb41b 100644
--- a/scene/3d/fog_volume.cpp
+++ b/scene/3d/fog_volume.cpp
@@ -101,7 +101,9 @@ AABB FogVolume::get_aabb() const {
TypedArray<String> FogVolume::get_configuration_warnings() const {
TypedArray<String> warnings = Node::get_configuration_warnings();
- if (!get_viewport()->find_world_3d()->get_environment()->is_volumetric_fog_enabled()) {
+ Ref<Environment> environment = get_viewport()->find_world_3d()->get_environment();
+
+ if (environment.is_valid() && !environment->is_volumetric_fog_enabled()) {
warnings.push_back(("Fog Volumes need volumetric fog to be enabled in the scene's Environment in order to be visible."));
}