mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
Merge branch 'fix_7446_coc_height' into 'master'
Fix #7446: Incorrect height after teleporting from one worldspace to another Closes #7446 See merge request OpenMW/openmw!3251
This commit is contained in:
commit
ee1246c756
@ -91,11 +91,12 @@ namespace MWScript
|
||||
|
||||
ESM::Position pos;
|
||||
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())
|
||||
{
|
||||
MWWorld::ActionTeleport(refId, pos, false).execute(playerPtr);
|
||||
playerPtr = world->getPlayerPtr(); // could be changed by ActionTeleport
|
||||
world->adjustPosition(playerPtr, false);
|
||||
return;
|
||||
}
|
||||
@ -121,7 +122,7 @@ namespace MWScript
|
||||
|
||||
ESM::Position pos;
|
||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||
const MWWorld::Ptr playerPtr = world->getPlayerPtr();
|
||||
MWWorld::Ptr playerPtr = world->getPlayerPtr();
|
||||
|
||||
osg::Vec2 posFromIndex
|
||||
= 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;
|
||||
|
||||
MWWorld::ActionTeleport(ESM::RefId::esm3ExteriorCell(x, y), pos, false).execute(playerPtr);
|
||||
playerPtr = world->getPlayerPtr(); // could be changed by ActionTeleport
|
||||
world->adjustPosition(playerPtr, false);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user