Browse Source

Fix unexpected editor dependency

kobewi 2 years ago
parent
commit
368b209cc3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      scene/debugger/scene_debugger.cpp

+ 4 - 0
scene/debugger/scene_debugger.cpp

@@ -220,8 +220,12 @@ void SceneDebugger::_save_node(ObjectID id, const String &p_path) {
 	Node *node = Object::cast_to<Node>(ObjectDB::get_instance(id));
 	Node *node = Object::cast_to<Node>(ObjectDB::get_instance(id));
 	ERR_FAIL_COND(!node);
 	ERR_FAIL_COND(!node);
 
 
+#ifdef TOOLS_ENABLED
 	HashMap<const Node *, Node *> duplimap;
 	HashMap<const Node *, Node *> duplimap;
 	Node *copy = node->duplicate_from_editor(duplimap);
 	Node *copy = node->duplicate_from_editor(duplimap);
+#else
+	Node *copy = node->duplicate();
+#endif
 
 
 	// Handle Unique Nodes.
 	// Handle Unique Nodes.
 	for (int i = 0; i < copy->get_child_count(false); i++) {
 	for (int i = 0; i < copy->get_child_count(false); i++) {