1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 12:42:11 +00:00
OpenMW/apps/openmw/mwworld/actionteleport.cpp
Lukasz Gromanowski e9844e1b37 Fixes #417: Apply weather instantly when teleporting
Changed teleporting detection from "position tracking" to manually
setting "teleportation" flag ( player->setTeleported(true) ).

Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
2013-12-31 20:40:23 +01:00

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);
}
}