From c98b0f713de6dace3582dac98d475fbdded02a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Mocquillon?= Date: Wed, 28 Jul 2021 10:29:16 +0200 Subject: [PATCH] If same area is defined in multiple plugin the last must wins --- apps/openmw/mwworld/store.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 41cba3b46b..125239e9a3 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -431,7 +431,12 @@ namespace MWWorld land.load(esm, isDeleted); // Same area defined in multiple plugins? -> last plugin wins - mStatic.insert(std::move(land)); + auto [it, inserted] = mStatic.insert(std::move(land)); + if (!inserted) { + auto nh = mStatic.extract(it); + nh.value() = std::move(land); + mStatic.insert(std::move(nh)); + } return RecordId("", isDeleted); }