mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Use server zone ID (SMSG_INIT_WORLD_STATES) for zone music selection
In online mode, SMSG_INIT_WORLD_STATES delivers the server-authoritative zone ID when entering a new area. Prefer this over the tile-based fallback so music transitions are accurate for small zones (city districts, caves, dungeon entrances) that don't align with 533-unit tile boundaries.
This commit is contained in:
parent
a654dd5e99
commit
6583ce9c57
1 changed files with 5 additions and 2 deletions
|
|
@ -3040,9 +3040,12 @@ void Renderer::update(float deltaTime) {
|
||||||
|
|
||||||
// Update zone detection and music
|
// Update zone detection and music
|
||||||
if (zoneManager && musicManager && terrainManager && camera) {
|
if (zoneManager && musicManager && terrainManager && camera) {
|
||||||
// First check tile-based zone
|
// Prefer server-authoritative zone ID (from SMSG_INIT_WORLD_STATES);
|
||||||
|
// fall back to tile-based lookup for single-player / offline mode.
|
||||||
|
const auto* gh = core::Application::getInstance().getGameHandler();
|
||||||
|
uint32_t serverZoneId = gh ? gh->getWorldStateZoneId() : 0;
|
||||||
auto tile = terrainManager->getCurrentTile();
|
auto tile = terrainManager->getCurrentTile();
|
||||||
uint32_t zoneId = zoneManager->getZoneId(tile.x, tile.y);
|
uint32_t zoneId = (serverZoneId != 0) ? serverZoneId : zoneManager->getZoneId(tile.x, tile.y);
|
||||||
|
|
||||||
bool insideTavern = false;
|
bool insideTavern = false;
|
||||||
bool insideBlacksmith = false;
|
bool insideBlacksmith = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue