1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 01:49:54 +00:00
openmw-tes3mp/apps/openmw/mwworld/action.cpp
2012-08-26 11:47:45 -03:00

38 lines
802 B
C++

#include "action.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
MWWorld::Action::Action() {
teleport = false;
}
MWWorld::Action::~Action() {}
void MWWorld::Action::execute (const Ptr& actor)
{
if (!mSoundId.empty())
{
if (teleport == 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;
}