mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-15 00:43:52 +00:00
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:
parent
a1575ec678
commit
34e384e1b2
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue