diff --git a/apps/openmw/mwworld/cellref.cpp b/apps/openmw/mwworld/cellref.cpp index 37e1be0ddf..35a04574ee 100644 --- a/apps/openmw/mwworld/cellref.cpp +++ b/apps/openmw/mwworld/cellref.cpp @@ -30,7 +30,7 @@ namespace MWWorld { } - const ESM::RefNum& CellRef::getRefNum() const + const ESM::RefNum& CellRef::getRefNum() const noexcept { return std::visit(ESM::VisitOverload{ [&](const ESM4::Reference& ref) -> const ESM::RefNum& { return ref.mId; }, diff --git a/apps/openmw/mwworld/cellref.hpp b/apps/openmw/mwworld/cellref.hpp index 73e721278e..1943fd9b54 100644 --- a/apps/openmw/mwworld/cellref.hpp +++ b/apps/openmw/mwworld/cellref.hpp @@ -27,7 +27,7 @@ namespace MWWorld explicit CellRef(const ESM4::ActorCharacter& ref); // Note: Currently unused for items in containers - const ESM::RefNum& getRefNum() const; + const ESM::RefNum& getRefNum() const noexcept; // Returns RefNum. // If RefNum is not set, assigns a generated one and changes the "lastAssignedRefNum" counter. diff --git a/apps/openmw/mwworld/ptrregistry.hpp b/apps/openmw/mwworld/ptrregistry.hpp index 3b535a220c..b640a22bfe 100644 --- a/apps/openmw/mwworld/ptrregistry.hpp +++ b/apps/openmw/mwworld/ptrregistry.hpp @@ -49,7 +49,7 @@ namespace MWWorld if (!refNum.isSet()) return; auto it = mIndex.find(refNum); - if (it != mIndex.end() && it->second.getBase() == &ref) + if (it != mIndex.end() && it->second.mRef == &ref) { mIndex.erase(it); ++mRevision;