Skip to content

Commit

Permalink
Play trap activation sound on trapped object, not actor
Browse files Browse the repository at this point in the history
  • Loading branch information
Allofich committed Jul 10, 2016
1 parent 251ba04 commit d4e656c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/openmw/mwclass/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/openmw/mwclass/door.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 2 additions & 3 deletions apps/openmw/mwworld/actiontrap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
};
}

Expand Down

0 comments on commit d4e656c

Please sign in to comment.