Fix MLIQ water parsing, skip interior water, clear movement on teleport
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run

- Remove bogus 2-byte skip after materialId in MLIQ parser that shifted
  all vertex heights and tile flags by 2 bytes (garbage data)
- Skip liquid loading for interior WMO groups (flag 0x2000) to prevent
  indoor water from rendering as outdoor canal water
- Clear movement inputs on teleport/portal to prevent auto-running after
  zone transfer (held keys persist through loading screen)
This commit is contained in:
Kelsi 2026-03-05 15:12:51 -08:00
parent 16daa2baf7
commit 08d40583c9
4 changed files with 15 additions and 11 deletions

View file

@ -875,8 +875,6 @@ void WaterRenderer::loadFromWMO([[maybe_unused]] const pipeline::WMOLiquid& liqu
const int vertexCount = gridWidth * gridHeight;
// WMO liquid base heights sit ~2 units above the visual waterline.
// Lower them to match surrounding terrain water and prevent clipping
// at bridge edges and walkways.
constexpr float WMO_WATER_Z_OFFSET = -1.0f;
float adjustedZ = surface.origin.z + WMO_WATER_Z_OFFSET;
surface.heights.assign(vertexCount, adjustedZ);
@ -895,7 +893,6 @@ void WaterRenderer::loadFromWMO([[maybe_unused]] const pipeline::WMOLiquid& liqu
for (size_t t = 0; t < tileCount; t++) {
bool hasLiquid = true;
if (t < liquid.flags.size()) {
// In WoW MLIQ format, (flags & 0x0F) == 0x0F means "no liquid" for this tile
if ((liquid.flags[t] & 0x0F) == 0x0F) {
hasLiquid = false;
}