From 05ad0dca343c7cf6bf2f305542d3ad6e99d63e92 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 20 Feb 2017 20:26:45 +0100 Subject: [PATCH] Use ActionTeleport in COE/COC commands --- apps/openmw/mwscript/cellextensions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwscript/cellextensions.cpp b/apps/openmw/mwscript/cellextensions.cpp index 43e8318b2..2cb76ef88 100644 --- a/apps/openmw/mwscript/cellextensions.cpp +++ b/apps/openmw/mwscript/cellextensions.cpp @@ -15,6 +15,7 @@ #include "../mwbase/world.hpp" #include "../mwworld/player.hpp" #include "../mwworld/cellstore.hpp" +#include "../mwworld/actionteleport.hpp" #include "../mwmechanics/actorutil.hpp" @@ -46,10 +47,9 @@ namespace MWScript ESM::Position pos; MWBase::World *world = MWBase::Environment::get().getWorld(); - world->getPlayer().setTeleported(true); if (world->findExteriorPosition(cell, pos)) { - world->changeToExteriorCell(pos, true); + MWWorld::ActionTeleport("", pos, false).execute(world->getPlayerPtr()); world->fixPosition(world->getPlayerPtr()); } else @@ -57,7 +57,7 @@ namespace MWScript // Change to interior even if findInteriorPosition() // yields false. In this case position will be zero-point. world->findInteriorPosition(cell, pos); - world->changeToInteriorCell(cell, pos, true); + MWWorld::ActionTeleport(cell, pos, false).execute(world->getPlayerPtr()); } } }; @@ -76,13 +76,13 @@ namespace MWScript ESM::Position pos; MWBase::World *world = MWBase::Environment::get().getWorld(); - world->getPlayer().setTeleported(true); + world->indexToPosition (x, y, pos.pos[0], pos.pos[1], true); pos.pos[2] = 0; pos.rot[0] = pos.rot[1] = pos.rot[2] = 0; - world->changeToExteriorCell (pos, true); + MWWorld::ActionTeleport("", pos, false).execute(world->getPlayerPtr()); world->fixPosition(world->getPlayerPtr()); } };