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
|
|
|
|
{
|
|
|
|
ActionTeleportPlayer::ActionTeleportPlayer (const std::string& cellName,
|
|
|
|
const ESM::Position& position)
|
|
|
|
: mCellName (cellName), mPosition (position)
|
|
|
|
{}
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
void ActionTeleportPlayer::execute()
|
2010-08-03 16:44:52 +00:00
|
|
|
{
|
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
|
|
|
}
|
|
|
|
}
|