mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 12:54:00 +00:00
Issue #370: replaced custom target handling in equip action with base class implementation
This commit is contained in:
parent
b51c42146f
commit
8c2b4f996c
@ -9,7 +9,7 @@
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
ActionEquip::ActionEquip (const MWWorld::Ptr& object) : mObject (object)
|
||||
ActionEquip::ActionEquip (const MWWorld::Ptr& object) : Action (false, object)
|
||||
{
|
||||
}
|
||||
|
||||
@ -19,13 +19,13 @@ namespace MWWorld
|
||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(player).getInventoryStore(player);
|
||||
|
||||
// slots that this item can be equipped in
|
||||
std::pair<std::vector<int>, bool> slots = MWWorld::Class::get(mObject).getEquipmentSlots(mObject);
|
||||
std::pair<std::vector<int>, bool> slots = MWWorld::Class::get(getTarget()).getEquipmentSlots(getTarget());
|
||||
|
||||
// retrieve ContainerStoreIterator to the item
|
||||
MWWorld::ContainerStoreIterator it = invStore.begin();
|
||||
for (; it != invStore.end(); ++it)
|
||||
{
|
||||
if (*it == mObject)
|
||||
if (*it == getTarget())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -8,8 +8,6 @@ namespace MWWorld
|
||||
{
|
||||
class ActionEquip : public Action
|
||||
{
|
||||
Ptr mObject;
|
||||
|
||||
virtual void executeImp (const Ptr& actor);
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user