Skip to content

Commit

Permalink
GH-532 Fix Godot 4.2.1 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Jul 20, 2024
1 parent 43379ec commit a04a9d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/script/nodes/scene/scene_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ bool OScriptNodeSceneNode::_set(const StringName& p_name, const Variant& p_value
if (Node* node = _get_referenced_node())
{
Ref<Script> script = node->get_script();
if (script.is_valid() && !script->get_global_name().is_empty())
_class_name = script->get_global_name();
else
_class_name = node->get_class();

String global_class;
if (script.is_valid())
global_class = ScriptServer::get_global_name(script);

_class_name = StringUtils::default_if_empty(global_class, node->get_class());
}
}

Expand Down

0 comments on commit a04a9d9

Please sign in to comment.