From 31a14952b7100098a032eb83d1de08fe42f39c6a Mon Sep 17 00:00:00 2001 From: "florent.teppe" Date: Wed, 7 Sep 2022 18:45:15 +0200 Subject: [PATCH] no more getIdType, only setIdType --- apps/openmw/mwworld/esmstore.cpp | 4 ++-- apps/openmw/mwworld/esmstore.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwworld/esmstore.cpp b/apps/openmw/mwworld/esmstore.cpp index 6f7f6c8a00..6c784aade0 100644 --- a/apps/openmw/mwworld/esmstore.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -311,9 +311,9 @@ void ESMStore::load(ESM::ESMReader &esm, Loading::Listener* listener, ESM::Dialo } } -int& ESMStore::getIdType(const std::string& id) +void ESMStore::setIdType(const std::string& id, ESM::RecNameInts type) { - return mStoreImp->mIds[id]; + mStoreImp->mIds[id] = type; } static std::size_t sTypeIndexCounter = 0; diff --git a/apps/openmw/mwworld/esmstore.hpp b/apps/openmw/mwworld/esmstore.hpp index 697a2c3db0..48ba6ec81a 100644 --- a/apps/openmw/mwworld/esmstore.hpp +++ b/apps/openmw/mwworld/esmstore.hpp @@ -165,7 +165,7 @@ namespace MWWorld template void removeMissingObjects(Store& store); - int& getIdType(const std::string& id); + void setIdType(const std::string& id, ESM::RecNameInts type); using LuaContent = std::variant< ESM::LuaScriptsCfg, // data from an omwaddon @@ -227,7 +227,7 @@ namespace MWWorld T *ptr = store.insert(record); if constexpr (std::is_convertible_v*, DynamicStore*>) { - getIdType(ptr->mId) = T::sRecordId; + setIdType(ptr->mId, T::sRecordId); } return ptr; } @@ -240,7 +240,7 @@ namespace MWWorld T *ptr = store.insert(x); if constexpr (std::is_convertible_v*, DynamicStore*>) { - getIdType(ptr->mId) = T::sRecordId; + setIdType(ptr->mId, T::sRecordId); } return ptr; } @@ -258,7 +258,7 @@ namespace MWWorld T *ptr = store.insertStatic(x); if constexpr (std::is_convertible_v*, DynamicStore*>) { - getIdType(ptr->mId) = T::sRecordId; + setIdType(ptr->mId, T::sRecordId); } return ptr; }