diff --git a/apps/openmw/mwworld/globals.cpp b/apps/openmw/mwworld/globals.cpp index 733270b06c..264109d17f 100644 --- a/apps/openmw/mwworld/globals.cpp +++ b/apps/openmw/mwworld/globals.cpp @@ -37,7 +37,7 @@ namespace MWWorld for (const ESM::Global& esmGlobal : globals) { - mVariables.emplace(esmGlobal.mId.getRefIdString(), esmGlobal); + mVariables.emplace(esmGlobal.mId, esmGlobal); } } @@ -98,8 +98,7 @@ namespace MWWorld // Deleted globals can't appear there, so isDeleted will be ignored here. global.load(reader, isDeleted); - Collection::iterator iter = mVariables.find(global.mId.getRefIdString()); - if (iter != mVariables.end()) + if (const auto iter = mVariables.find(global.mId); iter != mVariables.end()) iter->second = global; return true; diff --git a/apps/openmw/mwworld/globals.hpp b/apps/openmw/mwworld/globals.hpp index f53f71e845..ab94f0f8dd 100644 --- a/apps/openmw/mwworld/globals.hpp +++ b/apps/openmw/mwworld/globals.hpp @@ -2,8 +2,8 @@ #define GAME_MWWORLD_GLOBALS_H #include +#include #include -#include #include #include @@ -29,8 +29,7 @@ namespace MWWorld class Globals { private: - using Collection - = std::unordered_map; + using Collection = std::map>; Collection mVariables; // type, value