From 261fe9655c48c495fe2fd38a3abdf56c5ebb8b1c Mon Sep 17 00:00:00 2001 From: Shomy <61943525+shomykohai@users.noreply.github.com> Date: Wed, 9 Oct 2024 17:36:17 +0200 Subject: [PATCH] Don't stop from adding new pool if the script is the same Also check if the name is already taken --- addons/quest_system/quest_manager.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/quest_system/quest_manager.gd b/addons/quest_system/quest_manager.gd index 5530c9f..e51deb7 100644 --- a/addons/quest_system/quest_manager.gd +++ b/addons/quest_system/quest_manager.gd @@ -207,11 +207,11 @@ func add_new_pool(pool_path: String, pool_name: String) -> void: var pool_instance = pool.new(pool_name) # Make sure the pool does not exist yet - for pools in get_children(): - if pool_instance.get_script() == pools.get_script(): + for pools in get_all_pools(): + if pool_instance.get_script() == pools.get_script() && pool_name != pools.name: return - add_child(pool_instance) + add_child(pool_instance, true) func remove_pool(pool_name: String) -> void: