diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index 90f3c000e..ef24f1536 100644 --- a/apps/openmw/mwworld/actiontake.cpp +++ b/apps/openmw/mwworld/actiontake.cpp @@ -10,7 +10,7 @@ namespace MWWorld { - ActionTake::ActionTake (const MWWorld::Ptr& object) : mObject (object) {} + ActionTake::ActionTake (const MWWorld::Ptr& object) : Action (false, object) {} void ActionTake::executeImp (const Ptr& actor) { @@ -20,10 +20,8 @@ namespace MWWorld // insert into player's inventory MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPtr ("player", true); - MWWorld::Class::get (player).getContainerStore (player).add (mObject); + MWWorld::Class::get (player).getContainerStore (player).add (getTarget()); - // remove from world, if the item is currently in the world (it could also be in a container) - if (mObject.isInCell()) - MWBase::Environment::get().getWorld()->deleteObject (mObject); + MWBase::Environment::get().getWorld()->deleteObject (getTarget()); } } diff --git a/apps/openmw/mwworld/actiontake.hpp b/apps/openmw/mwworld/actiontake.hpp index 52a114acf..b0a9b8247 100644 --- a/apps/openmw/mwworld/actiontake.hpp +++ b/apps/openmw/mwworld/actiontake.hpp @@ -8,8 +8,6 @@ namespace MWWorld { class ActionTake : public Action { - MWWorld::Ptr mObject; - virtual void executeImp (const Ptr& actor); public: