Fix M2 texture loading, /unstuckgy, and WMO floor detection

- Add mutex to AssetManager::loadTexture/loadDBC/fileExists to prevent
  StormLib thread-safety races that silently fail texture reads; stop
  caching texture load failures so transient errors are retried.
- Replace /unstuckgy DBC lookup (which used wrong coordinate transform)
  with hardcoded safe locations per map.
- Widen WMO floor raycast from single grid cell to ±1 unit range query
  to catch bridge/walkway triangles at cell boundaries.
- Tighten swept collision hit threshold (0.5 → 0.15) and grid query
  margin (2.5 → 1.5) to prevent false-positive wall pushes.
- Tighten post-wall-push Z snap lower bound (-1.0 → -0.3) to prevent
  gradual floor sinking.
This commit is contained in:
Kelsi 2026-02-08 14:17:04 -08:00
parent 387cc5ddf4
commit 046d4615ea
5 changed files with 43 additions and 48 deletions

View file

@ -2307,7 +2307,8 @@ GLuint M2Renderer::loadTexture(const std::string& path) {
pipeline::BLPImage blp = assetManager->loadTexture(path);
if (!blp.isValid()) {
LOG_WARNING("M2: Failed to load texture: ", path);
textureCache[path] = whiteTexture;
// Don't cache failures — transient StormLib thread contention can
// cause reads to fail; next loadModel call will retry.
return whiteTexture;
}