diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-29 14:09:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-29 14:09:47 +0200 |
commit | 07cad9172228fc5e3e5620f3a3210e0bbfd9346c (patch) | |
tree | 38fbbc9688e2aa4867245bb6638c42b16c92b0dc /scene | |
parent | 343414cba57043965eadcdd6456ca373d2bfe5bb (diff) | |
parent | e058cf93bdab407a5fdce508f9abe21414ffc44f (diff) |
Merge pull request #54374 from Chaosus/fix_fogvolume_crash
Fix crashing of `FogVolume`s when `WorldEnvironment` was added
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/fog_volume.cpp | 4 |
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.")); } |