mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-09 12:42:11 +00:00
e9844e1b37
Changed teleporting detection from "position tracking" to manually setting "teleportation" flag ( player->setTeleported(true) ). Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
27 lines
673 B
C++
27 lines
673 B
C++
|
|
#include "actionteleport.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
#include "../mwbase/world.hpp"
|
|
#include "player.hpp"
|
|
|
|
namespace MWWorld
|
|
{
|
|
ActionTeleport::ActionTeleport (const std::string& cellName,
|
|
const ESM::Position& position)
|
|
: Action (true), mCellName (cellName), mPosition (position)
|
|
{
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|