diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 1fff23ad35..585d6a614b 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -665,10 +665,10 @@ namespace MWWorld if (!cell->getCell()->isExterior() || !cell->getCell()->mName.empty()) return cell->getCell()->mName; - if (const ESM::Region* region = getStore().get().search (cell->getCell()->mRegion)) + if (const ESM::Region* region = mStore.get().search (cell->getCell()->mRegion)) return region->mName; - return getStore().get().find ("sDefaultCellname")->mValue.getString(); + return mStore.get().find ("sDefaultCellname")->mValue.getString(); } void World::removeRefScript (MWWorld::RefData *ref) @@ -972,7 +972,7 @@ namespace MWWorld "sMonthHeartfire", "sMonthFrostfall", "sMonthSunsdusk", "sMonthEveningstar" }; - return getStore().get().find (monthNames[month])->mValue.getString(); + return mStore.get().find (monthNames[month])->mValue.getString(); } TimeStamp World::getTimeStamp() const @@ -1061,7 +1061,7 @@ namespace MWWorld if (mActivationDistanceOverride >= 0) return static_cast(mActivationDistanceOverride); - static const int iMaxActivateDist = getStore().get().find("iMaxActivateDist")->mValue.getInteger(); + static const int iMaxActivateDist = mStore.get().find("iMaxActivateDist")->mValue.getInteger(); return static_cast(iMaxActivateDist); } @@ -1826,7 +1826,7 @@ namespace MWWorld bool swimming = isSwimming(player); bool flying = isFlying(player); - static const float i1stPersonSneakDelta = getStore().get().find("i1stPersonSneakDelta")->mValue.getFloat(); + static const float i1stPersonSneakDelta = mStore.get().find("i1stPersonSneakDelta")->mValue.getFloat(); if (sneaking && !swimming && !flying) mRendering->getCamera()->setSneakOffset(i1stPersonSneakDelta); else @@ -2533,7 +2533,7 @@ namespace MWWorld mPhysics->markAsNonSolid (object); - if (actor == getPlayerPtr() && MWBase::Environment::get().getWorld()->getGodModeState()) + if (actor == getPlayerPtr() && mGodMode) continue; MWMechanics::DynamicStat health = stats.getHealth(); @@ -2566,8 +2566,8 @@ namespace MWWorld mPhysics->markAsNonSolid (object); - if (actor == getPlayerPtr() && getGodModeState()) - continue;; + if (actor == getPlayerPtr() && mGodMode) + continue; MWMechanics::DynamicStat health = stats.getHealth(); health.setCurrent(health.getCurrent()-healthPerSecond*MWBase::Environment::get().getFrameDuration()); @@ -2893,10 +2893,10 @@ namespace MWWorld if (!selectedSpell.empty()) { - const ESM::Spell* spell = getStore().get().find(selectedSpell); + const ESM::Spell* spell = mStore.get().find(selectedSpell); // Check mana - bool godmode = (isPlayer && getGodModeState()); + bool godmode = (isPlayer && mGodMode); MWMechanics::DynamicStat magicka = stats.getMagicka(); if (magicka.getCurrent() < spell->mData.mCost && !godmode) { @@ -2934,7 +2934,7 @@ namespace MWWorld if (!actor.isEmpty() && actor != MWMechanics::getPlayer() && !manualSpell) stats.getAiSequence().getCombatTargets(targetActors); - const float fCombatDistance = getStore().get().find("fCombatDistance")->mValue.getFloat(); + const float fCombatDistance = mStore.get().find("fCombatDistance")->mValue.getFloat(); osg::Vec3f hitPosition = actor.getRefData().getPosition().asVec3(); @@ -3016,7 +3016,7 @@ namespace MWWorld if (!selectedSpell.empty()) { - const ESM::Spell* spell = getStore().get().find(selectedSpell); + const ESM::Spell* spell = mStore.get().find(selectedSpell); cast.cast(spell); } else if (actor.getClass().hasInventoryStore(actor)) @@ -3389,8 +3389,8 @@ namespace MWWorld int bounty = player.getClass().getNpcStats(player).getBounty(); int playerGold = player.getClass().getContainerStore(player).count(ContainerStore::sGoldId); - float fCrimeGoldDiscountMult = getStore().get().find("fCrimeGoldDiscountMult")->mValue.getFloat(); - float fCrimeGoldTurnInMult = getStore().get().find("fCrimeGoldTurnInMult")->mValue.getFloat(); + static float fCrimeGoldDiscountMult = mStore.get().find("fCrimeGoldDiscountMult")->mValue.getFloat(); + static float fCrimeGoldTurnInMult = mStore.get().find("fCrimeGoldTurnInMult")->mValue.getFloat(); int discount = static_cast(bounty * fCrimeGoldDiscountMult); int turnIn = static_cast(bounty * fCrimeGoldTurnInMult); @@ -3455,7 +3455,7 @@ namespace MWWorld mPlayer->recordCrimeId(); confiscateStolenItems(player); - int iDaysinPrisonMod = getStore().get().find("iDaysinPrisonMod")->mValue.getInteger(); + static int iDaysinPrisonMod = mStore.get().find("iDaysinPrisonMod")->mValue.getInteger(); mDaysInPrison = std::max(1, bounty / iDaysinPrisonMod); return; @@ -3511,18 +3511,18 @@ namespace MWWorld void World::spawnRandomCreature(const std::string &creatureList) { - const ESM::CreatureLevList* list = getStore().get().find(creatureList); + const ESM::CreatureLevList* list = mStore.get().find(creatureList); - int iNumberCreatures = getStore().get().find("iNumberCreatures")->mValue.getInteger(); + static int iNumberCreatures = mStore.get().find("iNumberCreatures")->mValue.getInteger(); int numCreatures = 1 + Misc::Rng::rollDice(iNumberCreatures); // [1, iNumberCreatures] for (int i=0; i::const_iterator effectIt = effects.mList.begin(); effectIt != effects.mList.end(); ++effectIt) { - const ESM::MagicEffect* effect = getStore().get().find(effectIt->mEffectID); + const ESM::MagicEffect* effect = mStore.get().find(effectIt->mEffectID); if (effectIt->mRange != rangeType || (effectIt->mArea <= 0 && !ignore.isEmpty() && ignore.getClass().isActor())) continue; // Not right range type, or not area effect and hit an actor @@ -3565,9 +3565,9 @@ namespace MWWorld // Spawn the explosion orb effect const ESM::Static* areaStatic; if (!effect->mArea.empty()) - areaStatic = getStore().get().find (effect->mArea); + areaStatic = mStore.get().find (effect->mArea); else - areaStatic = getStore().get().find ("VFX_DefaultArea"); + areaStatic = mStore.get().find ("VFX_DefaultArea"); std::string texture = effect->mParticle;