2010-08-03 16:44:52 +00:00
|
|
|
|
|
|
|
#include "actionteleport.hpp"
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
#include "../mwbase/environment.hpp"
|
2012-07-03 10:30:50 +00:00
|
|
|
#include "../mwbase/world.hpp"
|
2010-08-03 16:44:52 +00:00
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
2012-07-27 10:00:10 +00:00
|
|
|
ActionTeleport::ActionTeleport (const std::string& cellName,
|
2010-08-03 16:44:52 +00:00
|
|
|
const ESM::Position& position)
|
|
|
|
: mCellName (cellName), mPosition (position)
|
2012-08-26 14:47:45 +00:00
|
|
|
{
|
|
|
|
teleport = true;
|
|
|
|
}
|
2010-08-03 16:44:52 +00:00
|
|
|
|
2012-07-27 10:00:10 +00:00
|
|
|
void ActionTeleport::executeImp (const Ptr& actor)
|
2010-08-03 16:44:52 +00:00
|
|
|
{
|
2012-08-26 14:47:45 +00:00
|
|
|
teleport = true;
|
|
|
|
|
2010-08-20 12:56:26 +00:00
|
|
|
if (mCellName.empty())
|
2012-04-23 13:27:03 +00:00
|
|
|
MWBase::Environment::get().getWorld()->changeToExteriorCell (mPosition);
|
2010-08-20 12:56:26 +00:00
|
|
|
else
|
2012-04-23 13:27:03 +00:00
|
|
|
MWBase::Environment::get().getWorld()->changeToInteriorCell (mCellName, mPosition);
|
2010-08-03 16:44:52 +00:00
|
|
|
}
|
|
|
|
}
|