Closed DinkyDyeAussie closed 2 years ago
This is all done in Lua
Argh, this is a bug I introduced with the new sound backend. I'll put the diff that fixes it here for later:
modified src/sound/music.cpp
@@ -51,7 +51,7 @@
-- Variables
----------------------------------------------------------------------------*/
-static volatile bool MusicFinished; /// Music ended and we need a new file
+volatile bool MusicFinished; /// Music ended and we need a new file
bool CallbackMusic; /// flag true callback ccl if stops
modified src/sound/sound_server.cpp
@@ -60,6 +60,8 @@ static bool EffectsEnabled = true;
static double VolumeScale = 1.0;
static int MusicVolume = 0;
+extern volatile bool MusicFinished;
+
/// Channels for sound effects and unit speech
struct SoundChannel {
Origin *Unit; /// pointer to unit, who plays the sound, if any
@@ -346,6 +348,7 @@ int PlayMusic(Mix_Music *sample)
{
if (sample) {
Mix_VolumeMusic(MusicVolume);
+ MusicFinished = false;
Mix_PlayMusic(sample, 0);
Mix_VolumeMusic(MusicVolume / 4.0);
return 0;
@@ -371,6 +374,7 @@ int PlayMusic(const std::string &file)
Mix_Music *music = LoadMusic(file);
if (music) {
+ MusicFinished = false;
Mix_FadeInMusic(music, 0, 200);
return 0;
} else {
Thanks @timfel. I've noticed this too.
@DinkyDyeAussie I'm planning to take a week around new year to fix a bunch of these issues and then do a new release
Sweet mate looking forward to it!
All the music files have been extracted, but the Briefing music isn't the right track - always something random that ends up being the first track played once you start actually playing the game. Same with the Victory/Defeat screen music too - always random.
What file can I edit to make this work like it should again? Code or Lua. Just tell me.