forked from mirror/openmw-tes3mp
Use ActionTeleport in COE/COC commands
This commit is contained in:
parent
7e02bb7348
commit
05ad0dca34
1 changed files with 5 additions and 5 deletions
|
@ -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());
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue