mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-29 03:36:40 +00:00
Do not teleport if dest < lowest point or collision disabled, add debug log
This commit is contained in:
parent
b43c7238e9
commit
e1cfd46f87
1 changed files with 8 additions and 1 deletions
|
@ -591,7 +591,14 @@ namespace MWWorld
|
|||
|
||||
ESM::Position newPos;
|
||||
const ESM::RefId refId = MWBase::Environment::get().getWorld()->findInteriorPosition(cellNameId, newPos);
|
||||
MWWorld::ActionTeleport(refId, newPos, false).execute(playerPtr);
|
||||
|
||||
// Only teleport if that teleport point is > the lowest point, rare edge case
|
||||
// also check that collision is enabled, which is opposite to Vanilla
|
||||
if (world->isActorCollisionEnabled(playerPtr) && newPos.pos[2] >= mLowestPoint - lowestPointAdjustment)
|
||||
{
|
||||
MWWorld::ActionTeleport(refId, newPos, false).execute(playerPtr);
|
||||
Log(Debug::Warning) << "Player position has been reset due to falling into the void.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue