mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:23:53 +00:00
Fix #7446: Incorrect height after teleporting from one worldspace to another
This commit is contained in:
parent
23f95cf762
commit
38f409e687
1 changed files with 4 additions and 2 deletions
|
@ -91,11 +91,12 @@ namespace MWScript
|
||||||
|
|
||||||
ESM::Position pos;
|
ESM::Position pos;
|
||||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||||
const MWWorld::Ptr playerPtr = world->getPlayerPtr();
|
MWWorld::Ptr playerPtr = world->getPlayerPtr();
|
||||||
|
|
||||||
if (const ESM::RefId refId = world->findExteriorPosition(cell, pos); !refId.empty())
|
if (const ESM::RefId refId = world->findExteriorPosition(cell, pos); !refId.empty())
|
||||||
{
|
{
|
||||||
MWWorld::ActionTeleport(refId, pos, false).execute(playerPtr);
|
MWWorld::ActionTeleport(refId, pos, false).execute(playerPtr);
|
||||||
|
playerPtr = world->getPlayerPtr(); // could be changed by ActionTeleport
|
||||||
world->adjustPosition(playerPtr, false);
|
world->adjustPosition(playerPtr, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -121,7 +122,7 @@ namespace MWScript
|
||||||
|
|
||||||
ESM::Position pos;
|
ESM::Position pos;
|
||||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||||
const MWWorld::Ptr playerPtr = world->getPlayerPtr();
|
MWWorld::Ptr playerPtr = world->getPlayerPtr();
|
||||||
|
|
||||||
osg::Vec2 posFromIndex
|
osg::Vec2 posFromIndex
|
||||||
= ESM::indexToPosition(ESM::ExteriorCellLocation(x, y, ESM::Cell::sDefaultWorldspaceId), true);
|
= ESM::indexToPosition(ESM::ExteriorCellLocation(x, y, ESM::Cell::sDefaultWorldspaceId), true);
|
||||||
|
@ -132,6 +133,7 @@ namespace MWScript
|
||||||
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
|
pos.rot[0] = pos.rot[1] = pos.rot[2] = 0;
|
||||||
|
|
||||||
MWWorld::ActionTeleport(ESM::RefId::esm3ExteriorCell(x, y), pos, false).execute(playerPtr);
|
MWWorld::ActionTeleport(ESM::RefId::esm3ExteriorCell(x, y), pos, false).execute(playerPtr);
|
||||||
|
playerPtr = world->getPlayerPtr(); // could be changed by ActionTeleport
|
||||||
world->adjustPosition(playerPtr, false);
|
world->adjustPosition(playerPtr, false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue