diff --git a/src/game/social_handler.cpp b/src/game/social_handler.cpp index 172a5c12..2e2e15d3 100644 --- a/src/game/social_handler.cpp +++ b/src/game/social_handler.cpp @@ -20,9 +20,12 @@ namespace game { +// LFG join result codes from LFGJoinResult enum (WotLK 3.3.5a). +// Case 0 = success (no error message needed), returns nullptr so the caller +// knows not to display an error string. static const char* lfgJoinResultString(uint8_t result) { switch (result) { - case 0: return nullptr; + case 0: return nullptr; // LFG_JOIN_OK case 1: return "Role check failed."; case 2: return "No LFG slots available for your group."; case 3: return "No LFG object found."; @@ -37,6 +40,7 @@ static const char* lfgJoinResultString(uint8_t result) { case 12: return "A party member is marked as a deserter."; case 13: return "You are on a random dungeon cooldown."; case 14: return "A party member is on a random dungeon cooldown."; + case 15: return "Cannot join dungeon finder."; // LFG_JOIN_INTERNAL_ERROR case 16: return "No spec/role available."; default: return "Cannot join dungeon finder."; } diff --git a/src/rendering/renderer.cpp b/src/rendering/renderer.cpp index c5f3ab05..17b7e996 100644 --- a/src/rendering/renderer.cpp +++ b/src/rendering/renderer.cpp @@ -1709,7 +1709,6 @@ void Renderer::setMounted(uint32_t mountInstId, uint32_t mountDisplayId, float h } // Ensure we have fallbacks for movement - if (mountAnims_.stand == 0) mountAnims_.stand = 0; // Force 0 even if not found if (mountAnims_.run == 0) mountAnims_.run = mountAnims_.stand; // Fallback to stand if no run core::Logger::getInstance().debug("Mount animation set: jumpStart=", mountAnims_.jumpStart, @@ -3502,7 +3501,9 @@ void Renderer::update(float deltaTime) { bool isIndoor = insideWmo; bool isSwimming = cameraController->isSwimming(); - // Check if inside blacksmith (96048 = Goldshire blacksmith) + // Detect blacksmith buildings to play ambient forge/anvil sounds. + // 96048 is the WMO group ID for the Goldshire blacksmith interior. + // TODO: extend to other smithy WMO IDs (Ironforge, Orgrimmar, etc.) bool isBlacksmith = (insideWmoId == 96048); // Sync weather audio with visual weather system @@ -3582,8 +3583,8 @@ void Renderer::update(float deltaTime) { lastLoggedWmoId = wmoModelId; } - // Blacksmith detection - if (wmoModelId == 96048) { // Goldshire blacksmith + // Detect blacksmith WMO for ambient forge sounds + if (wmoModelId == 96048) { // Goldshire blacksmith interior insideBlacksmith = true; LOG_INFO("Detected blacksmith WMO ", wmoModelId); } diff --git a/src/rendering/terrain_renderer.cpp b/src/rendering/terrain_renderer.cpp index 9ba0e732..bdd554f9 100644 --- a/src/rendering/terrain_renderer.cpp +++ b/src/rendering/terrain_renderer.cpp @@ -727,7 +727,7 @@ void TerrainRenderer::render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, c glm::vec3 cam = camera.getPosition(); // Find chunk nearest to camera const TerrainChunkGPU* nearest = nullptr; - float nearestDist = 1e30f; + float nearestDist = std::numeric_limits::max(); for (const auto& ch : chunks) { float dx = ch.boundingSphereCenter.x - cam.x; float dy = ch.boundingSphereCenter.y - cam.y; @@ -765,7 +765,10 @@ void TerrainRenderer::render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, c } glm::vec3 camPos = camera.getPosition(); - const float maxTerrainDistSq = 1200.0f * 1200.0f; + // Terrain chunks beyond this distance are culled. 1200 world units ≈ 9 ADT tiles, + // matching the asset loading radius (8 tiles) plus a buffer for pop-in avoidance. + constexpr float kMaxTerrainViewDist = 1200.0f; + const float maxTerrainDistSq = kMaxTerrainViewDist * kMaxTerrainViewDist; renderedChunks = 0; culledChunks = 0;