Explorar o código

Do not error flood if removing default environment. Closes #9945

Juan Linietsky %!s(int64=8) %!d(string=hai) anos
pai
achega
4d4c1dfc1b
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      scene/main/scene_tree.cpp

+ 4 - 0
scene/main/scene_tree.cpp

@@ -542,6 +542,10 @@ bool SceneTree::idle(float p_time) {
 
 			if (env_path != String()) {
 				fallback = ResourceLoader::load(env_path);
+				if (fallback.is_null()) {
+					//could not load fallback, set as empty
+					ProjectSettings::get_singleton()->set("rendering/environment/default_environment", "");
+				}
 			} else {
 				fallback.unref();
 			}