Add terrain water fix for Northshire Abbey fountain

Also handle terrain water (MH2O) not just WMO water. Lower terrain
water by 2 units within 300 units of fountain center at (-9048, -44, 93.7).
This commit is contained in:
Kelsi 2026-02-09 22:46:07 -08:00
parent b1df5d673b
commit bf6206b2b8

View file

@ -284,6 +284,25 @@ void WaterRenderer::loadFromTerrain(const pipeline::ADTTerrain& terrain, bool ap
}
}
// Fix Northshire Abbey fountain terrain water
// Fountain at approximately (-9048, -44, 93.7)
float tileWorldX = (32.0f - tileX) * 533.33333f;
float tileWorldY = (32.0f - tileY) * 533.33333f;
glm::vec3 northshireFountainPos(-9048.0f, -44.2f, 93.7f);
float distToFountain = glm::distance(glm::vec2(tileWorldX, tileWorldY),
glm::vec2(northshireFountainPos.x, northshireFountainPos.y));
// Lower fountain water by 2 units if within same tile/nearby
if (distToFountain < 300.0f && std::abs(layer.minHeight - northshireFountainPos.z) < 10.0f) {
LOG_INFO(" -> LOWERING Northshire fountain terrain water at tile (", tileX, ",", tileY,
") by 2 units (dist: ", distToFountain, ")");
for (float& h : surface.heights) {
h -= 2.0f;
}
surface.minHeight -= 2.0f;
surface.maxHeight -= 2.0f;
}
// Copy render mask
surface.mask = layer.mask;