1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 04:53:53 +00:00

update player position on engine start

This commit is contained in:
greye 2013-07-07 15:06:05 +04:00
parent f3d54a7ba4
commit e553f285b8

View file

@ -432,19 +432,14 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
{
// load cell
ESM::Position pos;
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
pos.pos[2] = 0;
MWBase::World *world = MWBase::Environment::get().getWorld();
if (const ESM::Cell *exterior = MWBase::Environment::get().getWorld()->getExterior (mCellName))
{
MWBase::Environment::get().getWorld()->indexToPosition (exterior->mData.mX, exterior->mData.mY,
pos.pos[0], pos.pos[1], true);
MWBase::Environment::get().getWorld()->changeToExteriorCell (pos);
if (world->findExteriorPosition(mCellName, pos)) {
world->changeToExteriorCell (pos);
}
else
{
pos.pos[0] = pos.pos[1] = 0;
MWBase::Environment::get().getWorld()->changeToInteriorCell (mCellName, pos);
else {
world->findInteriorPosition(mCellName, pos);
world->changeToInteriorCell (mCellName, pos);
}
}
else