Issue #370: fixed item taking sound

actorid
Marc Zinnschlag 13 years ago
parent 6813bafbfc
commit da041f902f

@ -11,7 +11,7 @@ const MWWorld::Ptr& MWWorld::Action::getTarget() const
return mTarget; 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() {} MWWorld::Action::~Action() {}
@ -20,7 +20,7 @@ void MWWorld::Action::execute (const Ptr& actor)
{ {
if (!mSoundId.empty()) if (!mSoundId.empty())
{ {
if (mTeleport && actor.getRefData().getHandle()=="player") if (mKeepSound && actor.getRefData().getHandle()=="player")
{ {
// sound moves with player when teleporting // sound moves with player when teleporting
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0, 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, MWBase::Environment::get().getSoundManager()->playSound3D (local ? actor : mTarget,
mSoundId, 1.0, 1.0, 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 class Action
{ {
std::string mSoundId; std::string mSoundId;
bool mTeleport; bool mKeepSound;
Ptr mTarget; Ptr mTarget;
// not implemented // not implemented
@ -26,8 +26,8 @@ namespace MWWorld
public: public:
Action (bool teleport = false, const Ptr& target = Ptr()); Action (bool keepSound = false, const Ptr& target = Ptr());
///< \param teleport action will teleport the actor ///< \param keepSound Keep playing the sound even if the object the sound is played on is removed.
virtual ~Action(); virtual ~Action();

@ -10,7 +10,7 @@
namespace MWWorld 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) void ActionTake::executeImp (const Ptr& actor)
{ {

Loading…
Cancel
Save