From ad6e21afa69e6dedc4c3a1307fb03852785fd6b6 Mon Sep 17 00:00:00 2001 From: Alexandr Savchenko Date: Wed, 28 Oct 2020 21:54:24 +0300 Subject: [PATCH] Update id for node created from free_list nodes --- imnodes.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imnodes.cpp b/imnodes.cpp index fe1d27b..04ad2fd 100644 --- a/imnodes.cpp +++ b/imnodes.cpp @@ -944,13 +944,16 @@ int object_pool_find_or_create_index(ObjectPool& nodes, const int node { node_idx = nodes.free_list.back(); nodes.free_list.pop_back(); + nodes.pool[node_idx].id = node_id; + nodes.in_use[node_idx] = true; } nodes.id_map.SetInt(static_cast(node_id), node_idx); EditorContext& editor = editor_context_get(); editor.node_depth_order.push_back(node_idx); + } else { + nodes.in_use[node_idx] = true; } - nodes.in_use[node_idx] = true; return node_idx; }