forked from teamnwah/openmw-tes3coop
update player position on engine start
This commit is contained in:
parent
f3d54a7ba4
commit
e553f285b8
1 changed files with 6 additions and 11 deletions
|
@ -432,19 +432,14 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
||||||
{
|
{
|
||||||
// load cell
|
// load cell
|
||||||
ESM::Position pos;
|
ESM::Position pos;
|
||||||
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
pos.pos[2] = 0;
|
|
||||||
|
|
||||||
if (const ESM::Cell *exterior = MWBase::Environment::get().getWorld()->getExterior (mCellName))
|
if (world->findExteriorPosition(mCellName, pos)) {
|
||||||
{
|
world->changeToExteriorCell (pos);
|
||||||
MWBase::Environment::get().getWorld()->indexToPosition (exterior->mData.mX, exterior->mData.mY,
|
|
||||||
pos.pos[0], pos.pos[1], true);
|
|
||||||
MWBase::Environment::get().getWorld()->changeToExteriorCell (pos);
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
world->findInteriorPosition(mCellName, pos);
|
||||||
pos.pos[0] = pos.pos[1] = 0;
|
world->changeToInteriorCell (mCellName, pos);
|
||||||
MWBase::Environment::get().getWorld()->changeToInteriorCell (mCellName, pos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue