mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-11-04 06:56:41 +00:00 
			
		
		
		
	Issue #370: replaced custom target handling in take action with base class implementation
This commit is contained in:
		
							parent
							
								
									ea1c3fe1e4
								
							
						
					
					
						commit
						8ed8dd649a
					
				
					 2 changed files with 3 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -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());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,8 +8,6 @@ namespace MWWorld
 | 
			
		|||
{
 | 
			
		||||
    class ActionTake : public Action
 | 
			
		||||
    {
 | 
			
		||||
            MWWorld::Ptr mObject;
 | 
			
		||||
 | 
			
		||||
            virtual void executeImp (const Ptr& actor);
 | 
			
		||||
 | 
			
		||||
        public:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue