forked from mirror/openmw-tes3mp
applying new interface vol.1, inconsistent
This commit is contained in:
parent
7cf0b8a680
commit
bd1bb2e55d
6 changed files with 34 additions and 26 deletions
|
@ -152,13 +152,16 @@ namespace MWClass
|
|||
if (typeGmst.empty())
|
||||
return -1;
|
||||
|
||||
float iWeight = MWBase::Environment::get().getWorld()->getStore().gameSettings.find (typeGmst)->getInt();
|
||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||
|
||||
if (iWeight * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fLightMaxMod")->getFloat()>=
|
||||
float iWeight = gmst.find (typeGmst)->getInt();
|
||||
|
||||
if (iWeight * gmst.find ("fLightMaxMod")->getFloat()>=
|
||||
ref->mBase->mData.mWeight)
|
||||
return ESM::Skill::LightArmor;
|
||||
|
||||
if (iWeight * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fMedMaxMod")->getFloat()>=
|
||||
if (iWeight * gmst.get<ESM::GameSetting>().find ("fMedMaxMod")->getFloat()>=
|
||||
ref->mBase->mData.mWeight)
|
||||
return ESM::Skill::MediumArmor;
|
||||
|
||||
|
|
|
@ -220,12 +220,13 @@ namespace MWClass
|
|||
// door leads to exterior, use cell name (if any), otherwise translated region name
|
||||
int x,y;
|
||||
MWBase::Environment::get().getWorld()->positionToIndex (ref->mRef.mDoorDest.pos[0], ref->mRef.mDoorDest.pos[1], x, y);
|
||||
const ESM::Cell* cell = store.cells.findExt(x,y);
|
||||
const ESM::Cell* cell = store.get<ESM::Cell>().find(x,y);
|
||||
if (cell->mName != "")
|
||||
dest = cell->mName;
|
||||
else
|
||||
{
|
||||
const ESM::Region* region = store.regions.search(cell->mRegion);
|
||||
const ESM::Region* region =
|
||||
store.get<ESM::Region>().find(cell->mRegion);
|
||||
dest = region->mName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
if (ref->mBase->mName == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
|
||||
if (ref->mBase->mName == MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sGold")->getString())
|
||||
{
|
||||
return std::string("Item Gold Up");
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ namespace MWClass
|
|||
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
|
||||
ptr.get<ESM::Miscellaneous>();
|
||||
|
||||
if (ref->mBase->mName == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sGold")->getString())
|
||||
if (ref->mBase->mName == MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sGold")->getString())
|
||||
{
|
||||
return std::string("Item Gold Down");
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ namespace MWClass
|
|||
|
||||
int count = ptr.getRefData().getCount();
|
||||
|
||||
bool isGold = (ref->mBase->mName == store.gameSettings.find("sGold")->getString());
|
||||
bool isGold = (ref->mBase->mName == store.get<ESM::GameSetting>().find("sGold")->getString());
|
||||
if (isGold && count == 1)
|
||||
count = ref->mBase->mData.mValue;
|
||||
|
||||
|
@ -162,7 +162,7 @@ namespace MWClass
|
|||
|
||||
if (ref->mRef.mSoul != "")
|
||||
{
|
||||
const ESM::Creature *creature = store.creatures.search(ref->mRef.mSoul);
|
||||
const ESM::Creature *creature = store.get<ESM::Creature>().find(ref->mRef.mSoul);
|
||||
info.caption += " (" + creature->mName + ")";
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ namespace MWClass
|
|||
const MWWorld::ESMStore &store =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
if (MWWorld::Class::get(ptr).getName(ptr) == store.gameSettings.find("sGold")->getString()) {
|
||||
if (MWWorld::Class::get(ptr).getName(ptr) == store.get<ESM::GameSetting().find("sGold")->getString()) {
|
||||
int goldAmount = ptr.getRefData().getCount();
|
||||
|
||||
std::string base = "Gold_001";
|
||||
|
|
|
@ -395,8 +395,10 @@ namespace MWClass
|
|||
|
||||
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||
|
||||
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
|
||||
ref->mBase->mClass);
|
||||
const ESM::Class *class_ =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Class>().find (
|
||||
ref->mBase->mClass
|
||||
);
|
||||
|
||||
stats.useSkill (skill, *class_, usageType);
|
||||
}
|
||||
|
|
|
@ -303,8 +303,8 @@ namespace MWClass
|
|||
std::string type = mapping[ref->mBase->mData.mType].first;
|
||||
std::string oneOrTwoHanded = mapping[ref->mBase->mData.mType].second;
|
||||
|
||||
text += store.gameSettings.find(type)->getString() +
|
||||
((oneOrTwoHanded != "") ? ", " + store.gameSettings.find(oneOrTwoHanded)->getString() : "");
|
||||
text += store.get<ESM::GameSetting>().find(type)->getString() +
|
||||
((oneOrTwoHanded != "") ? ", " + store.get<ESM::GameSetting>().find(oneOrTwoHanded)->getString() : "");
|
||||
|
||||
// weapon damage
|
||||
if (ref->mBase->mData.mType >= 9)
|
||||
|
|
|
@ -131,29 +131,29 @@ void MWMechanics::Alchemy::updateEffects()
|
|||
float x = getChance();
|
||||
|
||||
x *= mTools[ESM::Apparatus::MortarPestle].get<ESM::Apparatus>()->mBase->mData.mQuality;
|
||||
x *= MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fPotionStrengthMult")->getFloat();
|
||||
x *= MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionStrengthMult")->getFloat();
|
||||
|
||||
// value
|
||||
mValue = static_cast<int> (
|
||||
x * MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("iAlchemyMod")->getFloat());
|
||||
x * MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("iAlchemyMod")->getFloat());
|
||||
|
||||
// build quantified effect list
|
||||
for (std::set<EffectKey>::const_iterator iter (effects.begin()); iter!=effects.end(); ++iter)
|
||||
{
|
||||
const ESM::MagicEffect *magicEffect =
|
||||
MWBase::Environment::get().getWorld()->getStore().magicEffects.find (iter->mId);
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::MagicEffect>().find (iter->mId);
|
||||
|
||||
if (magicEffect->mData.mBaseCost<=0)
|
||||
throw std::runtime_error ("invalid base cost for magic effect " + iter->mId);
|
||||
|
||||
float fPotionT1MagMul =
|
||||
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fPotionT1MagMult")->getFloat();
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionT1MagMult")->getFloat();
|
||||
|
||||
if (fPotionT1MagMul<=0)
|
||||
throw std::runtime_error ("invalid gmst: fPotionT1MagMul");
|
||||
|
||||
float fPotionT1DurMult =
|
||||
MWBase::Environment::get().getWorld()->getStore().gameSettings.find ("fPotionT1DurMult")->getFloat();
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find ("fPotionT1DurMult")->getFloat();
|
||||
|
||||
if (fPotionT1DurMult<=0)
|
||||
throw std::runtime_error ("invalid gmst: fPotionT1DurMult");
|
||||
|
@ -192,18 +192,20 @@ void MWMechanics::Alchemy::updateEffects()
|
|||
|
||||
const ESM::Potion *MWMechanics::Alchemy::getRecord() const
|
||||
{
|
||||
for (MWWorld::RecListWithIDT<ESM::Potion>::MapType::const_iterator iter (
|
||||
MWBase::Environment::get().getWorld()->getStore().potions.list.begin());
|
||||
iter!=MWBase::Environment::get().getWorld()->getStore().potions.list.end(); ++iter)
|
||||
const MWWorld::Store<ESM::Potion> &potions =
|
||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Potion>();
|
||||
|
||||
MWWorld::Store<ESM::Potion>::iterator iter = potions.begin();
|
||||
for (; iter != potions.end(); ++iter)
|
||||
{
|
||||
if (iter->second.mEffects.mList.size()!=mEffects.size())
|
||||
if (iter->mEffects.mList.size() != mEffects.size())
|
||||
continue;
|
||||
|
||||
bool mismatch = false;
|
||||
|
||||
for (int i=0; i<static_cast<int> (iter->second.mEffects.mList.size()); ++iter)
|
||||
for (int i=0; i<static_cast<int> (iter->mEffects.mList.size()); ++iter)
|
||||
{
|
||||
const ESM::ENAMstruct& first = iter->second.mEffects.mList[i];
|
||||
const ESM::ENAMstruct& first = iter->mEffects.mList[i];
|
||||
const ESM::ENAMstruct& second = mEffects[i];
|
||||
|
||||
if (first.mEffectID!=second.mEffectID ||
|
||||
|
@ -221,7 +223,7 @@ const ESM::Potion *MWMechanics::Alchemy::getRecord() const
|
|||
}
|
||||
|
||||
if (!mismatch)
|
||||
return &iter->second;
|
||||
return &(*iter);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue