1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Don't use getTerrainHeightAt(pos) when adjusting position in ESM4 cell because this function is currently specific to ESM3.

This commit is contained in:
Petr Mikheev 2023-05-16 10:41:10 +02:00
parent c8056f6561
commit 169859025c

View File

@ -1361,10 +1361,9 @@ namespace MWWorld
return;
}
const float terrainHeight
= ptr.getCell()->isExterior() ? getTerrainHeightAt(pos) : -std::numeric_limits<float>::max();
pos.z() = std::max(pos.z(), terrainHeight)
+ 20; // place slightly above terrain. will snap down to ground with code below
if (ptr.getCell()->isExterior() && !ptr.getCell()->getCell()->isEsm4())
pos.z() = std::max(pos.z(), getTerrainHeightAt(pos));
pos.z() += 20; // place slightly above terrain. will snap down to ground with code below
// We still should trace down dead persistent actors - they do not use the "swimdeath" animation.
bool swims = ptr.getClass().isActor() && isSwimming(ptr)