diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 14 | ||||
-rw-r--r-- | modules/gltf/gltf_document.cpp | 1 |
2 files changed, 9 insertions, 6 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index de0dacece3..8d09249125 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -4278,11 +4278,15 @@ Variant GDScriptAnalyzer::make_variable_default_value(GDScriptParser::VariableNo } } else { GDScriptParser::DataType datatype = p_variable->get_datatype(); - if (datatype.is_hard_type() && datatype.kind == GDScriptParser::DataType::BUILTIN && datatype.builtin_type != Variant::OBJECT) { - if (datatype.builtin_type == Variant::ARRAY && datatype.has_container_element_type()) { - result = make_array_from_element_datatype(datatype.get_container_element_type()); - } else { - VariantInternal::initialize(&result, datatype.builtin_type); + if (datatype.is_hard_type()) { + if (datatype.kind == GDScriptParser::DataType::BUILTIN && datatype.builtin_type != Variant::OBJECT) { + if (datatype.builtin_type == Variant::ARRAY && datatype.has_container_element_type()) { + result = make_array_from_element_datatype(datatype.get_container_element_type()); + } else { + VariantInternal::initialize(&result, datatype.builtin_type); + } + } else if (datatype.kind == GDScriptParser::DataType::ENUM) { + result = 0; } } } diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 028028a103..e3ba290eb2 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -3285,7 +3285,6 @@ Error GLTFDocument::_parse_images(Ref<GLTFState> p_state, const String &p_base_p tex.instantiate(); tex->set_name(img->get_name()); tex->set_keep_compressed_buffer(true); - p_state->source_images.push_back(img); tex->create_from_image(img, PortableCompressedTexture2D::COMPRESSION_MODE_BASIS_UNIVERSAL); p_state->images.push_back(tex); p_state->source_images.push_back(img); |