Skip to content

Commit

Permalink
Merge pull request #54374 from Chaosus/fix_fogvolume_crash
Browse files Browse the repository at this point in the history
Fix crashing of `FogVolume`s when `WorldEnvironment` was added
  • Loading branch information
akien-mga authored Oct 29, 2021
2 parents 343414c + e058cf9 commit 07cad91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scene/3d/fog_volume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
}

Expand Down

0 comments on commit 07cad91

Please sign in to comment.