|
|
|
@ -135,23 +135,31 @@ namespace MWWorld
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Scene::playerCellChange (Ptr::CellStore *cell, const ESM::Position& position,
|
|
|
|
|
void
|
|
|
|
|
Scene::playerCellChange(
|
|
|
|
|
MWWorld::CellStore *cell,
|
|
|
|
|
const ESM::Position& pos,
|
|
|
|
|
bool adjustPlayerPos)
|
|
|
|
|
{
|
|
|
|
|
bool hasWater = cell->cell->data.flags & cell->cell->HasWater;
|
|
|
|
|
mPhysics->setCurrentWater(hasWater, cell->cell->water);
|
|
|
|
|
if (adjustPlayerPos)
|
|
|
|
|
{
|
|
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setPos (position.pos[0], position.pos[1], position.pos[2]);
|
|
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setRot (position.rot[0], position.rot[1], position.rot[2]);
|
|
|
|
|
|
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
|
|
|
MWWorld::Ptr player = world->getPlayer().getPlayer();
|
|
|
|
|
|
|
|
|
|
if (adjustPlayerPos) {
|
|
|
|
|
world->moveObject(player, pos.pos[0], pos.pos[1], pos.pos[2]);
|
|
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setRot (pos.rot[0], pos.rot[1], pos.rot[2]);
|
|
|
|
|
}
|
|
|
|
|
world->getPlayer().setCell(cell);
|
|
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().setCell (cell);
|
|
|
|
|
MWMechanics::MechanicsManager *mechMgr =
|
|
|
|
|
MWBase::Environment::get().getMechanicsManager();
|
|
|
|
|
|
|
|
|
|
MWBase::Environment::get().getMechanicsManager()->addActor (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
|
|
|
|
MWBase::Environment::get().getMechanicsManager()->watchActor (MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
|
|
|
|
mechMgr->addActor(player);
|
|
|
|
|
mechMgr->watchActor(player);
|
|
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->changeCell( mCurrentCell );
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->changeCell(mCurrentCell);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos)
|
|
|
|
|