diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index e9968c38f..6f0a1b49f 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -1070,12 +1070,10 @@ namespace MWWorld if (search(marker.first) == 0) { ESM::Static newMarker = ESM::Static(marker.first, marker.second); - mStatic.insert(std::make_pair(marker.first, newMarker)); - - std::map::iterator found = mStatic.find(marker.first); - if (found != mStatic.end()) + std::pair ret = mStatic.insert(std::make_pair(marker.first, newMarker)); + if (ret.first != mStatic.end()) { - mShared.push_back(&found->second); + mShared.push_back(&ret.first->second); } } }