diff --git a/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp b/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp index f998cf3..3b13254 100644 --- a/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp +++ b/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.cpp @@ -239,11 +239,14 @@ void WorldEditorImGui::rmObjSet() noexcept { pushCommand(m_doc, m_palMgr.selectedIdx); } -ox::Error WorldEditorImGui::handleObjectSetUpdate(ox::StringView path) noexcept { - if (ox::any_of(m_doc.objSets.begin(), m_doc.objSets.end(), [path](ObjectSetEntry const&set) { - return set.path == path; - })) { +ox::Error WorldEditorImGui::handleObjectSetUpdate(ox::StringView, ox::UUID const&uuid) noexcept { + auto const matches = [uuid](ObjectSetEntry const&set) { + auto const [setUuid, err] = keel::uuidUrlToUuid(set.path); + return !err && setUuid == uuid; + }; + if (ox::any_of(m_doc.objSets.begin(), m_doc.objSets.end(), matches)) { oxReturnError(buildObjCache(keelCtx(m_sctx.tctx), m_doc).moveTo(m_objCache)); + oxReturnError(loadWorldStatic(m_objCache, m_doc).moveTo(m_worldStatic)); } return loadObjectSets(); } diff --git a/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.hpp b/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.hpp index 501d955..1f9633a 100644 --- a/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.hpp +++ b/src/jasper/modules/world/src/studio/worldeditor/worldeditor-imgui.hpp @@ -72,7 +72,7 @@ class WorldEditorImGui: public studio::Editor { void rmObjSet() noexcept; // handles the updating of an object set in case it is one used by this world - ox::Error handleObjectSetUpdate(ox::StringView path) noexcept; + ox::Error handleObjectSetUpdate(ox::StringView path, ox::UUID const&) noexcept; ox::Error loadObjectSets() noexcept;