mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-23 11:54:58 -04:00
Issue #370: fixed item taking sound
This commit is contained in:
parent
6813bafbfc
commit
da041f902f
@ -11,7 +11,7 @@ const MWWorld::Ptr& MWWorld::Action::getTarget() const
|
||||
return mTarget;
|
||||
}
|
||||
|
||||
MWWorld::Action::Action (bool teleport, const Ptr& target) : mTeleport (teleport), mTarget (target)
|
||||
MWWorld::Action::Action (bool keepSound, const Ptr& target) : mKeepSound (keepSound), mTarget (target)
|
||||
{}
|
||||
|
||||
MWWorld::Action::~Action() {}
|
||||
@ -20,7 +20,7 @@ void MWWorld::Action::execute (const Ptr& actor)
|
||||
{
|
||||
if (!mSoundId.empty())
|
||||
{
|
||||
if (mTeleport && actor.getRefData().getHandle()=="player")
|
||||
if (mKeepSound && actor.getRefData().getHandle()=="player")
|
||||
{
|
||||
// sound moves with player when teleporting
|
||||
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0,
|
||||
@ -32,7 +32,7 @@ void MWWorld::Action::execute (const Ptr& actor)
|
||||
|
||||
MWBase::Environment::get().getSoundManager()->playSound3D (local ? actor : mTarget,
|
||||
mSoundId, 1.0, 1.0,
|
||||
mTeleport ? MWBase::SoundManager::Play_NoTrack : MWBase::SoundManager::Play_Normal);
|
||||
mKeepSound ? MWBase::SoundManager::Play_NoTrack : MWBase::SoundManager::Play_Normal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace MWWorld
|
||||
class Action
|
||||
{
|
||||
std::string mSoundId;
|
||||
bool mTeleport;
|
||||
bool mKeepSound;
|
||||
Ptr mTarget;
|
||||
|
||||
// not implemented
|
||||
@ -26,8 +26,8 @@ namespace MWWorld
|
||||
|
||||
public:
|
||||
|
||||
Action (bool teleport = false, const Ptr& target = Ptr());
|
||||
///< \param teleport action will teleport the actor
|
||||
Action (bool keepSound = false, const Ptr& target = Ptr());
|
||||
///< \param keepSound Keep playing the sound even if the object the sound is played on is removed.
|
||||
|
||||
virtual ~Action();
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace MWWorld
|
||||
{
|
||||
ActionTake::ActionTake (const MWWorld::Ptr& object) : Action (false, object) {}
|
||||
ActionTake::ActionTake (const MWWorld::Ptr& object) : Action (true, object) {}
|
||||
|
||||
void ActionTake::executeImp (const Ptr& actor)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user