diff --git a/apps/openmw/mwworld/esmstore.hpp b/apps/openmw/mwworld/esmstore.hpp index 0a6ea01b3..dfe2ac03a 100644 --- a/apps/openmw/mwworld/esmstore.hpp +++ b/apps/openmw/mwworld/esmstore.hpp @@ -145,6 +145,11 @@ namespace MWWorld throw std::runtime_error("Storage for this type not exist"); } + template + Store &get() { + throw std::runtime_error("Storage for this type not exist (non-const)"); + } + template T *insert(const T &x) { Store &store = const_cast &>(get()); @@ -396,6 +401,231 @@ namespace MWWorld inline const Store &ESMStore::get() const { return mAttributes; } + + template <> + inline Store &ESMStore::get() { + return mActivators; + } + + template <> + inline Store &ESMStore::get() { + return mPotions; + } + + template <> + inline Store &ESMStore::get() { + return mAppas; + } + + template <> + inline Store &ESMStore::get() { + return mArmors; + } + + template <> + inline Store &ESMStore::get() { + return mBodyParts; + } + + template <> + inline Store &ESMStore::get() { + return mBooks; + } + + template <> + inline Store &ESMStore::get() { + return mBirthSigns; + } + + template <> + inline Store &ESMStore::get() { + return mClasses; + } + + template <> + inline Store &ESMStore::get() { + return mClothes; + } + + template <> + inline Store &ESMStore::get() { + return mContChange; + } + + template <> + inline Store &ESMStore::get() { + return mContainers; + } + + template <> + inline Store &ESMStore::get() { + return mCreatures; + } + + template <> + inline Store &ESMStore::get() { + return mCreaChange; + } + + template <> + inline Store &ESMStore::get() { + return mDialogs; + } + + template <> + inline Store &ESMStore::get() { + return mDoors; + } + + template <> + inline Store &ESMStore::get() { + return mEnchants; + } + + template <> + inline Store &ESMStore::get() { + return mFactions; + } + + template <> + inline Store &ESMStore::get() { + return mGlobals; + } + + template <> + inline Store &ESMStore::get() { + return mIngreds; + } + + template <> + inline Store &ESMStore::get() { + return mCreatureLists; + } + + template <> + inline Store &ESMStore::get() { + return mItemLists; + } + + template <> + inline Store &ESMStore::get() { + return mLights; + } + + template <> + inline Store &ESMStore::get() { + return mLockpicks; + } + + template <> + inline Store &ESMStore::get() { + return mMiscItems; + } + + template <> + inline Store &ESMStore::get() { + return mNpcs; + } + + template <> + inline Store &ESMStore::get() { + return mNpcChange; + } + + template <> + inline Store &ESMStore::get() { + return mProbes; + } + + template <> + inline Store &ESMStore::get() { + return mRaces; + } + + template <> + inline Store &ESMStore::get() { + return mRegions; + } + + template <> + inline Store &ESMStore::get() { + return mRepairs; + } + + template <> + inline Store &ESMStore::get() { + return mSoundGens; + } + + template <> + inline Store &ESMStore::get() { + return mSounds; + } + + template <> + inline Store &ESMStore::get() { + return mSpells; + } + + template <> + inline Store &ESMStore::get() { + return mStartScripts; + } + + template <> + inline Store &ESMStore::get() { + return mStatics; + } + + template <> + inline Store &ESMStore::get() { + return mWeapons; + } + + template <> + inline Store &ESMStore::get() { + return mGameSettings; + } + + template <> + inline Store &ESMStore::get() { + return mScripts; + } + + template <> + inline Store &ESMStore::get() { + return mCells; + } + + template <> + inline Store &ESMStore::get() { + return mLands; + } + + template <> + inline Store &ESMStore::get() { + return mLandTextures; + } + + template <> + inline Store &ESMStore::get() { + return mPathgrids; + } + + template <> + inline Store &ESMStore::get() { + return mMagicEffects; + } + + template <> + inline Store &ESMStore::get() { + return mSkills; + } + + template <> + inline Store &ESMStore::get() { + return mAttributes; + } } #endif diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 9f5b7520c..532d335c3 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1058,12 +1058,12 @@ namespace MWWorld // door leads to exterior, use cell name (if any), otherwise translated region name int x,y; positionToIndex (ref.mRef.mDoorDest.pos[0], ref.mRef.mDoorDest.pos[1], x, y); - const ESM::Cell* cell = mStore.get().find(x,y); + const ESM::Cell* cell = ((const ESMStore &) mStore).get().find(x,y); if (cell->mName != "") dest = cell->mName; else { - dest = mStore.get().find(cell->mRegion)->mName; + dest = ((const ESMStore &) mStore).get().find(cell->mRegion)->mName; } }