1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwworld/action.cpp
Marc Zinnschlag d0cebea580 some cleanup
2012-08-26 18:50:47 +02:00

38 lines
872 B
C++

#include "action.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
MWWorld::Action::Action (bool teleport) : mTeleport (teleport)
{}
MWWorld::Action::~Action() {}
void MWWorld::Action::execute (const Ptr& actor)
{
if (!mSoundId.empty())
{
if (mTeleport == true)
{
//this is a teleport action, so we need to call playSound
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0,
MWBase::SoundManager::Play_NoTrack);
}
else
{
MWBase::Environment::get().getSoundManager()->playSound3D (actor, mSoundId, 1.0, 1.0,
MWBase::SoundManager::Play_NoTrack);
}
}
executeImp (actor);
}
void MWWorld::Action::setSound (const std::string& id)
{
mSoundId = id;
}