fix: tavern music always played first track — index never incremented

tavernTrackIndex was initialized to 0 but never modified, so the player
always heard TavernAlliance01.mp3. Added post-increment to rotate
through the 3 available tracks on each tavern entry.
This commit is contained in:
Kelsi 2026-03-29 20:27:08 -07:00
parent a1575ec678
commit 34e384e1b2

View file

@ -3601,8 +3601,10 @@ void Renderer::update(float deltaTime) {
"Sound\\Music\\ZoneMusic\\TavernHuman\\RA_HumanTavern1A.mp3",
"Sound\\Music\\ZoneMusic\\TavernHuman\\RA_HumanTavern2A.mp3",
};
// Rotate through tracks so the player doesn't always hear the same one.
// Post-increment: first visit plays index 0, next plays 1, etc.
static int tavernTrackIndex = 0;
tavernMusic = tavernTracks[tavernTrackIndex % tavernTracks.size()];
tavernMusic = tavernTracks[tavernTrackIndex++ % tavernTracks.size()];
LOG_INFO("Detected tavern WMO ", wmoModelId, ", playing: ", tavernMusic);
}
}