2010-08-03 16:44:52 +00:00
|
|
|
|
|
|
|
#include "actionteleport.hpp"
|
|
|
|
|
|
|
|
#include "environment.hpp"
|
|
|
|
#include "world.hpp"
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
ActionTeleportPlayer::ActionTeleportPlayer (const std::string& cellName,
|
|
|
|
const ESM::Position& position)
|
|
|
|
: mCellName (cellName), mPosition (position)
|
|
|
|
{}
|
|
|
|
|
2010-08-30 01:12:54 +00:00
|
|
|
void ActionTeleportPlayer::execute (Environment& environment)
|
2010-08-03 16:44:52 +00:00
|
|
|
{
|
2010-08-20 12:56:26 +00:00
|
|
|
if (mCellName.empty())
|
|
|
|
environment.mWorld->changeToExteriorCell (mPosition);
|
|
|
|
else
|
2011-02-10 09:38:45 +00:00
|
|
|
environment.mWorld->changeToInteriorCell (mCellName, mPosition);
|
2010-08-03 16:44:52 +00:00
|
|
|
}
|
|
|
|
}
|