Skip to content

Commit

Permalink
CraterCrashGH-385 Fix instantiate scene to respect input pin
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Jun 8, 2024
1 parent a12f6b6 commit 11202e5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/script/nodes/scene/instantiate_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@
class OScriptNodeInstantiateSceneInstance : public OScriptNodeInstance
{
DECLARE_SCRIPT_NODE_INSTANCE(OScriptNodeInstantiateScene);
String _scene_name;
Ref<PackedScene> _scene;

public:
int step(OScriptNodeExecutionContext& p_context) override
{
if (!_scene.is_valid())
{
_scene = ResourceLoader::get_singleton()->load(_scene_name);
_scene = ResourceLoader::get_singleton()->load(p_context.get_input(0));
if (!_scene.is_valid())
{
p_context.set_error(GDEXTENSION_CALL_ERROR_INVALID_METHOD, "Failed to load scene");
Expand Down Expand Up @@ -162,6 +161,5 @@ OScriptNodeInstance* OScriptNodeInstantiateScene::instantiate(OScriptInstance* p
OScriptNodeInstantiateSceneInstance* i = memnew(OScriptNodeInstantiateSceneInstance);
i->_node = this;
i->_instance = p_instance;
i->_scene_name = _scene;
return i;
}

0 comments on commit 11202e5

Please sign in to comment.