forked from teamnwah/openmw-tes3coop
some cleanup
This commit is contained in:
parent
450656a890
commit
d0cebea580
3 changed files with 17 additions and 22 deletions
|
@ -6,9 +6,8 @@
|
||||||
|
|
||||||
#include "../mwbase/soundmanager.hpp"
|
#include "../mwbase/soundmanager.hpp"
|
||||||
|
|
||||||
MWWorld::Action::Action() {
|
MWWorld::Action::Action (bool teleport) : mTeleport (teleport)
|
||||||
teleport = false;
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
MWWorld::Action::~Action() {}
|
MWWorld::Action::~Action() {}
|
||||||
|
|
||||||
|
@ -16,7 +15,7 @@ void MWWorld::Action::execute (const Ptr& actor)
|
||||||
{
|
{
|
||||||
if (!mSoundId.empty())
|
if (!mSoundId.empty())
|
||||||
{
|
{
|
||||||
if (teleport == true)
|
if (mTeleport == true)
|
||||||
{
|
{
|
||||||
//this is a teleport action, so we need to call playSound
|
//this is a teleport action, so we need to call playSound
|
||||||
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0,
|
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0,
|
||||||
|
|
|
@ -11,6 +11,7 @@ namespace MWWorld
|
||||||
class Action
|
class Action
|
||||||
{
|
{
|
||||||
std::string mSoundId;
|
std::string mSoundId;
|
||||||
|
bool mTeleport;
|
||||||
|
|
||||||
// not implemented
|
// not implemented
|
||||||
Action (const Action& action);
|
Action (const Action& action);
|
||||||
|
@ -18,12 +19,10 @@ namespace MWWorld
|
||||||
|
|
||||||
virtual void executeImp (const Ptr& actor) = 0;
|
virtual void executeImp (const Ptr& actor) = 0;
|
||||||
|
|
||||||
protected:
|
|
||||||
bool teleport; //True if the action will teleport the actor
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Action();
|
Action (bool teleport = false);
|
||||||
|
///< \param teleport action will teleport the actor
|
||||||
|
|
||||||
virtual ~Action();
|
virtual ~Action();
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,12 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
ActionTeleport::ActionTeleport (const std::string& cellName,
|
ActionTeleport::ActionTeleport (const std::string& cellName,
|
||||||
const ESM::Position& position)
|
const ESM::Position& position)
|
||||||
: mCellName (cellName), mPosition (position)
|
: Action (true), mCellName (cellName), mPosition (position)
|
||||||
{
|
{
|
||||||
teleport = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionTeleport::executeImp (const Ptr& actor)
|
void ActionTeleport::executeImp (const Ptr& actor)
|
||||||
{
|
{
|
||||||
teleport = true;
|
|
||||||
|
|
||||||
if (mCellName.empty())
|
if (mCellName.empty())
|
||||||
MWBase::Environment::get().getWorld()->changeToExteriorCell (mPosition);
|
MWBase::Environment::get().getWorld()->changeToExteriorCell (mPosition);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue