From 84e3b9289132a22a4142ad5af3b2792e05a0d43e Mon Sep 17 00:00:00 2001 From: Tanasart Date: Mon, 29 Jul 2024 10:14:15 +0700 Subject: [PATCH] - Fix error when loading the same project in the one session. --- scripts/load_function/load_function.gml | 1 + scripts/node_collection/node_collection.gml | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/load_function/load_function.gml b/scripts/load_function/load_function.gml index 0ed74cdf6..716a428d1 100644 --- a/scripts/load_function/load_function.gml +++ b/scripts/load_function/load_function.gml @@ -106,6 +106,7 @@ function LOAD_AT(path, params = new __loadParams()) { #region var temp_path = TEMPDIR; directory_verify(temp_path); + ds_map_clear(APPEND_MAP); var temp_file_path = TEMPDIR + string(UUID_generate(6)); if(file_exists_empty(temp_file_path)) file_delete(temp_file_path); diff --git a/scripts/node_collection/node_collection.gml b/scripts/node_collection/node_collection.gml index 3b30f7a29..62780c315 100644 --- a/scripts/node_collection/node_collection.gml +++ b/scripts/node_collection/node_collection.gml @@ -574,21 +574,25 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc return nodes[i].inputs[| 0].getValue(); } - var _fr = outputs[| preview_channel].from.inputs[| 0]; + var _oj = outputs[| preview_channel]; + if(is_undefined(_oj)) return noone; + + var _fr = _oj.from.inputs[| 0]; return _fr.value_from == noone? noone : _fr.value_from.node.getGraphPreviewSurface(); } function getPreviewingNode() { - var _outJ = outputs[| preview_channel]; + var _oj = outputs[| preview_channel]; + if(is_undefined(_oj)) return self; - switch(_outJ.type) { + switch(_oj.type) { case VALUE_TYPE.d3Mesh : case VALUE_TYPE.d3Camera : case VALUE_TYPE.d3Light : case VALUE_TYPE.d3Scene : case VALUE_TYPE.d3object : case VALUE_TYPE.sdf : - var _fr = _outJ.from.inputs[| 0]; + var _fr = _oj.from.inputs[| 0]; return _fr.value_from == noone? self : _fr.value_from.node; }