mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-22 12:39:59 +00:00
Minor factorisation in apps/openmw/mwmechanics/actors.cpp
This commit is contained in:
parent
7400050b38
commit
39cd679ca9
@ -60,22 +60,24 @@ int getBoundItemSlot (const std::string& itemId)
|
|||||||
static std::map<std::string, int> boundItemsMap;
|
static std::map<std::string, int> boundItemsMap;
|
||||||
if (boundItemsMap.empty())
|
if (boundItemsMap.empty())
|
||||||
{
|
{
|
||||||
std::string boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundBootsID")->mValue.getString();
|
const auto& store = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
|
|
||||||
|
std::string boundId = store.find("sMagicBoundBootsID")->mValue.getString();
|
||||||
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Boots;
|
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Boots;
|
||||||
|
|
||||||
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundCuirassID")->mValue.getString();
|
boundId = store.find("sMagicBoundCuirassID")->mValue.getString();
|
||||||
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Cuirass;
|
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Cuirass;
|
||||||
|
|
||||||
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundLeftGauntletID")->mValue.getString();
|
boundId = store.find("sMagicBoundLeftGauntletID")->mValue.getString();
|
||||||
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_LeftGauntlet;
|
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_LeftGauntlet;
|
||||||
|
|
||||||
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundRightGauntletID")->mValue.getString();
|
boundId = store.find("sMagicBoundRightGauntletID")->mValue.getString();
|
||||||
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_RightGauntlet;
|
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_RightGauntlet;
|
||||||
|
|
||||||
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundHelmID")->mValue.getString();
|
boundId = store.find("sMagicBoundHelmID")->mValue.getString();
|
||||||
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Helmet;
|
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_Helmet;
|
||||||
|
|
||||||
boundId = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("sMagicBoundShieldID")->mValue.getString();
|
boundId = store.find("sMagicBoundShieldID")->mValue.getString();
|
||||||
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_CarriedLeft;
|
boundItemsMap[boundId] = MWWorld::InventoryStore::Slot_CarriedLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user