From 58b7927a36c45905365fc6054a7f535c6f02991c Mon Sep 17 00:00:00 2001 From: greye Date: Tue, 6 Nov 2012 18:17:32 +0400 Subject: [PATCH] move 'player' record to dynamic --- apps/openmw/mwworld/esmstore.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/openmw/mwworld/esmstore.cpp b/apps/openmw/mwworld/esmstore.cpp index a69a8fde7..d0f00fa3a 100644 --- a/apps/openmw/mwworld/esmstore.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -95,6 +95,16 @@ void ESMStore::setUp() mSkills.setUp(); mMagicEffects.setUp(); mAttributes.setUp(); + + ESM::NPC item; + item.mId = "player"; + + std::vector::iterator pIt = + std::lower_bound(mNpcs.mStatic.begin(), mNpcs.mStatic.end(), item, RecordCmp()); + assert(pIt != mNpcs.mStatic.end() && pIt->mId == "player"); + + mNpcs.insert(*pIt); + mNpcs.mStatic.erase(pIt); } } // end namespace