diff --git a/apps/openmw/mwclass/armor.cpp b/apps/openmw/mwclass/armor.cpp index a511207c41..c8e09d4333 100644 --- a/apps/openmw/mwclass/armor.cpp +++ b/apps/openmw/mwclass/armor.cpp @@ -94,7 +94,7 @@ namespace MWClass MWWorld::LiveCellRef *ref = ptr.get(); - std::vector slots; + std::vector slots_; const int size = 11; @@ -116,11 +116,11 @@ namespace MWClass for (int i=0; imBase->mData.mType) { - slots.push_back (int (sMapping[i][1])); + slots_.push_back (int (sMapping[i][1])); break; } - return std::make_pair (slots, false); + return std::make_pair (slots_, false); } int Armor::getEquipmentSkill (const MWWorld::Ptr& ptr) const @@ -288,12 +288,12 @@ namespace MWClass MWWorld::InventoryStore& invStore = MWWorld::Class::get(npc).getInventoryStore(npc); // slots that this item can be equipped in - std::pair, bool> slots = MWWorld::Class::get(ptr).getEquipmentSlots(ptr); + std::pair, bool> slots_ = MWWorld::Class::get(ptr).getEquipmentSlots(ptr); std::string npcRace = npc.get()->mBase->mRace; - for (std::vector::const_iterator slot=slots.first.begin(); - slot!=slots.first.end(); ++slot) + for (std::vector::const_iterator slot=slots_.first.begin(); + slot!=slots_.first.end(); ++slot) { // Beast races cannot equip shoes / boots, or full helms (head part vs hair part) diff --git a/apps/openmw/mwclass/clothing.cpp b/apps/openmw/mwclass/clothing.cpp index 2dbb7ee6fd..0a23821a92 100644 --- a/apps/openmw/mwclass/clothing.cpp +++ b/apps/openmw/mwclass/clothing.cpp @@ -78,12 +78,12 @@ namespace MWClass MWWorld::LiveCellRef *ref = ptr.get(); - std::vector slots; + std::vector slots_; if (ref->mBase->mData.mType==ESM::Clothing::Ring) { - slots.push_back (int (MWWorld::InventoryStore::Slot_LeftRing)); - slots.push_back (int (MWWorld::InventoryStore::Slot_RightRing)); + slots_.push_back (int (MWWorld::InventoryStore::Slot_LeftRing)); + slots_.push_back (int (MWWorld::InventoryStore::Slot_RightRing)); } else { @@ -105,12 +105,12 @@ namespace MWClass for (int i=0; imBase->mData.mType) { - slots.push_back (int (sMapping[i][1])); + slots_.push_back (int (sMapping[i][1])); break; } } - return std::make_pair (slots, false); + return std::make_pair (slots_, false); } int Clothing::getEquipmentSkill (const MWWorld::Ptr& ptr) const @@ -232,12 +232,12 @@ namespace MWClass std::pair Clothing::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const { // slots that this item can be equipped in - std::pair, bool> slots = MWWorld::Class::get(ptr).getEquipmentSlots(ptr); + std::pair, bool> slots_ = MWWorld::Class::get(ptr).getEquipmentSlots(ptr); std::string npcRace = npc.get()->mBase->mRace; - for (std::vector::const_iterator slot=slots.first.begin(); - slot!=slots.first.end(); ++slot) + for (std::vector::const_iterator slot=slots_.first.begin(); + slot!=slots_.first.end(); ++slot) { // Beast races cannot equip shoes / boots, or full helms (head part vs hair part) diff --git a/apps/openmw/mwclass/light.cpp b/apps/openmw/mwclass/light.cpp index a593eb295a..a031d25563 100644 --- a/apps/openmw/mwclass/light.cpp +++ b/apps/openmw/mwclass/light.cpp @@ -121,12 +121,12 @@ namespace MWClass MWWorld::LiveCellRef *ref = ptr.get(); - std::vector slots; + std::vector slots_; if (ref->mBase->mData.mFlags & ESM::Light::Carry) - slots.push_back (int (MWWorld::InventoryStore::Slot_CarriedLeft)); + slots_.push_back (int (MWWorld::InventoryStore::Slot_CarriedLeft)); - return std::make_pair (slots, false); + return std::make_pair (slots_, false); } int Light::getValue (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwclass/lockpick.cpp b/apps/openmw/mwclass/lockpick.cpp index 5931a0102d..aff36ba81d 100644 --- a/apps/openmw/mwclass/lockpick.cpp +++ b/apps/openmw/mwclass/lockpick.cpp @@ -74,11 +74,11 @@ namespace MWClass std::pair, bool> Lockpick::getEquipmentSlots (const MWWorld::Ptr& ptr) const { - std::vector slots; + std::vector slots_; - slots.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight)); + slots_.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight)); - return std::make_pair (slots, false); + return std::make_pair (slots_, false); } int Lockpick::getValue (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwclass/probe.cpp b/apps/openmw/mwclass/probe.cpp index 951265f40e..5cff140a65 100644 --- a/apps/openmw/mwclass/probe.cpp +++ b/apps/openmw/mwclass/probe.cpp @@ -73,11 +73,11 @@ namespace MWClass std::pair, bool> Probe::getEquipmentSlots (const MWWorld::Ptr& ptr) const { - std::vector slots; + std::vector slots_; - slots.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight)); + slots_.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight)); - return std::make_pair (slots, false); + return std::make_pair (slots_, false); } int Probe::getValue (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwclass/weapon.cpp b/apps/openmw/mwclass/weapon.cpp index 4cb090328e..eaed597fcf 100644 --- a/apps/openmw/mwclass/weapon.cpp +++ b/apps/openmw/mwclass/weapon.cpp @@ -100,23 +100,23 @@ namespace MWClass MWWorld::LiveCellRef *ref = ptr.get(); - std::vector slots; + std::vector slots_; bool stack = false; if (ref->mBase->mData.mType==ESM::Weapon::Arrow || ref->mBase->mData.mType==ESM::Weapon::Bolt) { - slots.push_back (int (MWWorld::InventoryStore::Slot_Ammunition)); + slots_.push_back (int (MWWorld::InventoryStore::Slot_Ammunition)); stack = true; } else if (ref->mBase->mData.mType==ESM::Weapon::MarksmanThrown) { - slots.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight)); + slots_.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight)); stack = true; } else - slots.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight)); + slots_.push_back (int (MWWorld::InventoryStore::Slot_CarriedRight)); - return std::make_pair (slots, stack); + return std::make_pair (slots_, stack); } int Weapon::getEquipmentSkill (const MWWorld::Ptr& ptr) const @@ -384,11 +384,11 @@ namespace MWClass std::pair Weapon::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const { - std::pair, bool> slots = MWWorld::Class::get(ptr).getEquipmentSlots(ptr); + std::pair, bool> slots_ = MWWorld::Class::get(ptr).getEquipmentSlots(ptr); // equip the item in the first free slot - for (std::vector::const_iterator slot=slots.first.begin(); - slot!=slots.first.end(); ++slot) + for (std::vector::const_iterator slot=slots_.first.begin(); + slot!=slots_.first.end(); ++slot) { if(*slot == MWWorld::InventoryStore::Slot_CarriedRight) { diff --git a/apps/openmw/mwgui/spellwindow.cpp b/apps/openmw/mwgui/spellwindow.cpp index d5e3abc110..e9b2c0fa8a 100644 --- a/apps/openmw/mwgui/spellwindow.cpp +++ b/apps/openmw/mwgui/spellwindow.cpp @@ -110,9 +110,9 @@ namespace MWGui allowSelectedItem = false; // if the selected item can be equipped, make sure that it actually is equipped - std::pair, bool> slots; - slots = MWWorld::Class::get(selectedItem).getEquipmentSlots(selectedItem); - if (!slots.first.empty()) + std::pair, bool> slots_; + slots_ = MWWorld::Class::get(selectedItem).getEquipmentSlots(selectedItem); + if (!slots_.first.empty()) { bool equipped = false; for (int i=0; i < MWWorld::InventoryStore::Slots; ++i) diff --git a/apps/openmw/mwworld/actionequip.cpp b/apps/openmw/mwworld/actionequip.cpp index 38033340c0..2a50b8a600 100644 --- a/apps/openmw/mwworld/actionequip.cpp +++ b/apps/openmw/mwworld/actionequip.cpp @@ -40,7 +40,7 @@ namespace MWWorld } // slots that this item can be equipped in - std::pair, bool> slots = MWWorld::Class::get(getTarget()).getEquipmentSlots(getTarget()); + std::pair, bool> slots_ = MWWorld::Class::get(getTarget()).getEquipmentSlots(getTarget()); // retrieve ContainerStoreIterator to the item MWWorld::ContainerStoreIterator it = invStore.begin(); @@ -57,12 +57,12 @@ namespace MWWorld bool equipped = false; // equip the item in the first free slot - for (std::vector::const_iterator slot=slots.first.begin(); - slot!=slots.first.end(); ++slot) + for (std::vector::const_iterator slot=slots_.first.begin(); + slot!=slots_.first.end(); ++slot) { // if all slots are occupied, replace the last slot - if (slot == --slots.first.end()) + if (slot == --slots_.first.end()) { invStore.equip(*slot, it, actor); equipped = true; diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index 7bfc11d846..a5711acfca 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -33,10 +33,10 @@ void MWWorld::InventoryStore::copySlots (const InventoryStore& store) } } -void MWWorld::InventoryStore::initSlots (TSlots& slots) +void MWWorld::InventoryStore::initSlots (TSlots& slots_) { for (int i=0; i, bool> slots; + std::pair, bool> slots_; if (iterator!=end()) { - slots = Class::get (*iterator).getEquipmentSlots (*iterator); + slots_ = Class::get (*iterator).getEquipmentSlots (*iterator); - if (std::find (slots.first.begin(), slots.first.end(), slot)==slots.first.end()) + if (std::find (slots_.first.begin(), slots_.first.end(), slot)==slots_.first.end()) throw std::runtime_error ("invalid slot"); } @@ -103,7 +103,7 @@ void MWWorld::InventoryStore::equip (int slot, const ContainerStoreIterator& ite unequipSlot(slot, actor); // unstack item pointed to by iterator if required - if (iterator!=end() && !slots.second && iterator->getRefData().getCount() > 1) // if slots.second is true, item can stay stacked when equipped + if (iterator!=end() && !slots_.second && iterator->getRefData().getCount() > 1) // if slots.second is true, item can stay stacked when equipped { // add the item again with a count of count-1, then set the count of the original (that will be equipped) to 1 int count = iterator->getRefData().getCount(); @@ -148,8 +148,8 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& npc) const MWMechanics::NpcStats& stats = MWWorld::Class::get(npc).getNpcStats(npc); MWWorld::InventoryStore& invStore = MWWorld::Class::get(npc).getInventoryStore(npc); - TSlots slots; - initSlots (slots); + TSlots slots_; + initSlots (slots_); // Disable model update during auto-equip mActorModelUpdateEnabled = false; @@ -167,11 +167,11 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& npc) { bool use = false; - if (slots.at (*iter2)==end()) + if (slots_.at (*iter2)==end()) use = true; // slot was empty before -> skip all further checks else { - Ptr old = *slots.at (*iter2); + Ptr old = *slots_.at (*iter2); if (!use) { @@ -229,15 +229,15 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& npc) } } - slots[*iter2] = iter; + slots_[*iter2] = iter; break; } } bool changed = false; - for (std::size_t i=0; i