From 8ed8dd649a9ca68ef0f23c71dc77a2c086100c6f Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 4 Sep 2012 15:34:44 +0200 Subject: [PATCH] Issue #370: replaced custom target handling in take action with base class implementation --- apps/openmw/mwworld/actiontake.cpp | 8 +++----- apps/openmw/mwworld/actiontake.hpp | 2 -- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index 90f3c000e2..ef24f15361 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 52a114acf1..b0a9b82478 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: