Play trap activation sound on trapped object, not actor

coverity_scan^2
Allofich 9 years ago
parent 251ba041f3
commit d4e656ceaf

@ -173,7 +173,7 @@ namespace MWClass
else
{
// Activate trap
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(actor, ptr.getCellRef().getTrap(), ptr));
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr));
action->setSound(trapActivationSound);
return action;
}

@ -139,7 +139,7 @@ namespace MWClass
if(!ptr.getCellRef().getTrap().empty())
{
// Trap activation
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(actor, ptr.getCellRef().getTrap(), ptr));
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTrap(ptr.getCellRef().getTrap(), ptr));
action->setSound(trapActivationSound);
return action;
}

@ -18,10 +18,9 @@ namespace MWWorld
public:
/// @param spellId
/// @param actor Actor that activated the trap
/// @param trapSource
ActionTrap (const Ptr& actor, const std::string& spellId, const Ptr& trapSource)
: Action(false, actor), mSpellId(spellId), mTrapSource(trapSource) {}
ActionTrap (const std::string& spellId, const Ptr& trapSource)
: Action(false, trapSource), mSpellId(spellId), mTrapSource(trapSource) {}
};
}

Loading…
Cancel
Save