1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-20 18:39: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;
ESM::NPC mPlayerTemplate;
unsigned int mDynamicCount;
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)
it->second->clearDynamic();
mNpcs.insert(mPlayerTemplate);
movePlayerRecord();
}
void movePlayerRecord ()
{
mPlayerTemplate = *mNpcs.find("player");
mNpcs.eraseStatic(mPlayerTemplate.mId);
mNpcs.insert(mPlayerTemplate);
auto player = mNpcs.find("player");
mNpcs.insert(*player);
}
void load(ESM::ESMReader &esm, Loading::Listener* listener);