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