forked from mirror/openmw-tes3mp
Issue #370: replaced custom target handling in equip action with base class implementation
This commit is contained in:
parent
b51c42146f
commit
8c2b4f996c
2 changed files with 3 additions and 5 deletions
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
namespace MWWorld
|
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);
|
MWWorld::InventoryStore& invStore = MWWorld::Class::get(player).getInventoryStore(player);
|
||||||
|
|
||||||
// slots that this item can be equipped in
|
// 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
|
// retrieve ContainerStoreIterator to the item
|
||||||
MWWorld::ContainerStoreIterator it = invStore.begin();
|
MWWorld::ContainerStoreIterator it = invStore.begin();
|
||||||
for (; it != invStore.end(); ++it)
|
for (; it != invStore.end(); ++it)
|
||||||
{
|
{
|
||||||
if (*it == mObject)
|
if (*it == getTarget())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
class ActionEquip : public Action
|
class ActionEquip : public Action
|
||||||
{
|
{
|
||||||
Ptr mObject;
|
|
||||||
|
|
||||||
virtual void executeImp (const Ptr& actor);
|
virtual void executeImp (const Ptr& actor);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue