diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index 5966a99b9..c8fa087c2 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -859,16 +859,16 @@ namespace MWWorld // Try to overwrite existing record if (!pathgrid.mCell.empty()) { - std::pair found = mInt.insert(std::make_pair(pathgrid.mCell, pathgrid)); - if (found.second) - found.first->second = pathgrid; + std::pair ret = mInt.insert(std::make_pair(pathgrid.mCell, pathgrid)); + if (!ret.second) + ret.first->second = pathgrid; } else { - std::pair found = mExt.insert(std::make_pair(std::make_pair(pathgrid.mData.mX, pathgrid.mData.mY), + std::pair ret = mExt.insert(std::make_pair(std::make_pair(pathgrid.mData.mX, pathgrid.mData.mY), pathgrid)); - if (found.second) - found.first->second = pathgrid; + if (!ret.second) + ret.first->second = pathgrid; } } @@ -953,9 +953,9 @@ namespace MWWorld record.load(esm); // Try to overwrite existing record - std::pair found = mStatic.insert(std::make_pair(record.mIndex, record)); - if (found.second) - found.first->second = record; + std::pair ret = mStatic.insert(std::make_pair(record.mIndex, record)); + if (!ret.second) + ret.first->second = record; } int getSize() const {