1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-21 18:09:39 +00:00

Don't erase the player

This commit is contained in:
Evil Eye 2021-03-23 20:43:52 +01:00
parent 5e1960a76a
commit e79036f4e0

View file

@ -80,8 +80,6 @@ namespace MWWorld
std::map<int, StoreBase *> mStores; std::map<int, StoreBase *> mStores;
ESM::NPC mPlayerTemplate;
unsigned int mDynamicCount; unsigned int mDynamicCount;
mutable std::map<std::string, std::weak_ptr<MWMechanics::SpellList> > mSpellListCache; mutable std::map<std::string, std::weak_ptr<MWMechanics::SpellList> > mSpellListCache;
@ -172,14 +170,13 @@ namespace MWWorld
for (std::map<int, StoreBase *>::iterator it = mStores.begin(); it != mStores.end(); ++it) for (std::map<int, StoreBase *>::iterator it = mStores.begin(); it != mStores.end(); ++it)
it->second->clearDynamic(); it->second->clearDynamic();
mNpcs.insert(mPlayerTemplate); movePlayerRecord();
} }
void movePlayerRecord () void movePlayerRecord ()
{ {
mPlayerTemplate = *mNpcs.find("player"); auto player = mNpcs.find("player");
mNpcs.eraseStatic(mPlayerTemplate.mId); mNpcs.insert(*player);
mNpcs.insert(mPlayerTemplate);
} }
void load(ESM::ESMReader &esm, Loading::Listener* listener); void load(ESM::ESMReader &esm, Loading::Listener* listener);