1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/apps/openmw/mwworld/actionteleport.cpp

27 lines
673 B
C++
Raw Normal View History

#include "actionteleport.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "player.hpp"
namespace MWWorld
{
2012-07-27 10:00:10 +00:00
ActionTeleport::ActionTeleport (const std::string& cellName,
const ESM::Position& position)
2012-08-26 16:50:47 +00:00
: Action (true), mCellName (cellName), mPosition (position)
{
}
2012-07-27 10:00:10 +00:00
void ActionTeleport::executeImp (const Ptr& actor)
{
MWBase::World* world = MWBase::Environment::get().getWorld();
world->getPlayer().setTeleported(true);
if (mCellName.empty())
world->changeToExteriorCell (mPosition);
else
world->changeToInteriorCell (mCellName, mPosition);
}
}