diff --git a/apps/openmw/mwworld/action.cpp b/apps/openmw/mwworld/action.cpp index 98682e705..a5199fb3e 100644 --- a/apps/openmw/mwworld/action.cpp +++ b/apps/openmw/mwworld/action.cpp @@ -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); } } diff --git a/apps/openmw/mwworld/action.hpp b/apps/openmw/mwworld/action.hpp index c47565113..d8e5d93bb 100644 --- a/apps/openmw/mwworld/action.hpp +++ b/apps/openmw/mwworld/action.hpp @@ -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(); diff --git a/apps/openmw/mwworld/actiontake.cpp b/apps/openmw/mwworld/actiontake.cpp index ef24f1536..fd28dd52e 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) : Action (false, object) {} + ActionTake::ActionTake (const MWWorld::Ptr& object) : Action (true, object) {} void ActionTake::executeImp (const Ptr& actor) {