Merge pull request #49713 from nekomatata/fix-export-var-override-runtime

Fix export var override in PackedScene at runtime
This commit is contained in:
Rémi Verschelde 2021-06-29 12:45:43 +02:00 committed by GitHub
commit 653f544ca3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -471,7 +471,9 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
StringName type = p_node->get_class();
Ref<Script> script = p_node->get_script();
if (script.is_valid()) {
if (Engine::get_singleton()->is_editor_hint() && script.is_valid()) {
// Should be called in the editor only and not at runtime,
// otherwise it can cause problems because of missing instance state support.
script->update_exports();
}