1
0
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:
Marc Zinnschlag 2012-09-04 15:27:10 +02:00
parent b51c42146f
commit 8c2b4f996c
2 changed files with 3 additions and 5 deletions

View File

@ -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;
}

View File

@ -8,8 +8,6 @@ namespace MWWorld
{
class ActionEquip : public Action
{
Ptr mObject;
virtual void executeImp (const Ptr& actor);
public: