2012-07-27 12:00:10 +02:00
|
|
|
|
|
|
|
#include "action.hpp"
|
|
|
|
|
2012-07-27 12:19:25 +02:00
|
|
|
#include "../mwbase/environment.hpp"
|
2012-08-26 11:47:45 -03:00
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
|
2012-08-09 14:33:21 +02:00
|
|
|
#include "../mwbase/soundmanager.hpp"
|
2012-07-27 12:19:25 +02:00
|
|
|
|
2012-08-26 18:50:47 +02:00
|
|
|
MWWorld::Action::Action (bool teleport) : mTeleport (teleport)
|
|
|
|
{}
|
2012-07-27 12:00:10 +02:00
|
|
|
|
|
|
|
MWWorld::Action::~Action() {}
|
|
|
|
|
|
|
|
void MWWorld::Action::execute (const Ptr& actor)
|
|
|
|
{
|
2012-07-27 12:19:25 +02:00
|
|
|
if (!mSoundId.empty())
|
2012-08-19 20:11:50 -03:00
|
|
|
{
|
2012-08-26 18:50:47 +02:00
|
|
|
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);
|
|
|
|
}
|
2012-08-19 20:11:50 -03:00
|
|
|
}
|
2012-07-27 12:19:25 +02:00
|
|
|
|
2012-07-27 12:00:10 +02:00
|
|
|
executeImp (actor);
|
|
|
|
}
|
2012-07-27 12:19:25 +02:00
|
|
|
|
2012-08-26 11:47:45 -03:00
|
|
|
void MWWorld::Action::setSound (const std::string& id)
|
2012-07-27 12:19:25 +02:00
|
|
|
{
|
|
|
|
mSoundId = id;
|
|
|
|
}
|