From 41542dedf7686bd222aa99df4270fc5b3f20e928 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 6 Dec 2014 17:24:05 +0100 Subject: [PATCH] Fix map insert return value mixup (Fixes #2192) --- apps/openmw/mwworld/store.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 {