I got your game, and I see that it is SeekMP3PosMillis(0) that causes this.
This is a bit complicated, and I think that's actually a bug introduced when new Audio system was created (in 3.2).
//--------------------------------------------
EDIT: just to clarify, what you sent me is all the files that you actually run the game with? The crash is related to missing VOX file.
Have you saved these games with the VOX and tried to restore without one?
//--------------------------------------------
Thing is that saved game remembers a currently playing music, and tries to start it on load. But there's no VOX, so it can't play.
At the same time, there's a certain internal value, that tells engine that the music track of certain type WAS present at the time of saving the game. Although sound clip is missing, this value is not reset.
When SeekMP3PosMillis() is called, engine checks that value, and thinks that there's a music track of certain format playing, but does not actually check if anything is loaded in the audio channel. So it then tries to work with non-existing channel, and crashes due accessing invalid memory.
How to deal with it? Normally, this should be fixed in the engine (which I might do).
Meanwhile, add IsMusicPlaying() check before SeekMP3PosMillis() call. Thankfully, IsMusicPlaying() makes sufficient checks and recognizes when the music is not loaded; it also resets the aforementioned value, so any subsequent music-related functions will work correctly.
Actually you may just write:
Code: ags
Yes, without even "if" condition, because, as I said, it will bring game state to consistency simply by being called.
This is a bit complicated, and I think that's actually a bug introduced when new Audio system was created (in 3.2).
//--------------------------------------------
EDIT: just to clarify, what you sent me is all the files that you actually run the game with? The crash is related to missing VOX file.
Have you saved these games with the VOX and tried to restore without one?
//--------------------------------------------
Thing is that saved game remembers a currently playing music, and tries to start it on load. But there's no VOX, so it can't play.
At the same time, there's a certain internal value, that tells engine that the music track of certain type WAS present at the time of saving the game. Although sound clip is missing, this value is not reset.
When SeekMP3PosMillis() is called, engine checks that value, and thinks that there's a music track of certain format playing, but does not actually check if anything is loaded in the audio channel. So it then tries to work with non-existing channel, and crashes due accessing invalid memory.
How to deal with it? Normally, this should be fixed in the engine (which I might do).
Meanwhile, add IsMusicPlaying() check before SeekMP3PosMillis() call. Thankfully, IsMusicPlaying() makes sufficient checks and recognizes when the music is not loaded; it also resets the aforementioned value, so any subsequent music-related functions will work correctly.
Actually you may just write:
IsMusicPlaying();
SeekMP3PosMillis (0);
Yes, without even "if" condition, because, as I said, it will bring game state to consistency simply by being called.
