Reset player position when spawning in fallback cell

This commit is contained in:
scrawl 2014-07-28 16:59:46 +02:00
parent 4773d754c6
commit 18b3e71be5

View file

@ -253,6 +253,10 @@ namespace MWWorld
catch (...)
{
// Cell no longer exists. Place the player in a default cell.
ESM::Position pos = mPlayer.mData.getPosition();
MWBase::Environment::get().getWorld()->indexToPosition(0, 0, pos.pos[0], pos.pos[1], true);
pos.pos[2] = 0;
mPlayer.mData.setPosition(pos);
mCellStore = world.getExterior(0,0);
}