|
@@ -588,6 +588,11 @@ bool MusicEntry::play()
|
|
|
float timeToStart = owner->trackPositions[currentName];
|
|
|
startPosition = std::round(timeToStart * 1000);
|
|
|
|
|
|
+ // erase stored position:
|
|
|
+ // if music track will be interrupted again - new position will be written in stop() method
|
|
|
+ // if music track is not interrupted and will finish by timeout/end of file - it will restart from begginning as it should
|
|
|
+ owner->trackPositions.erase( owner->trackPositions.find(currentName) );
|
|
|
+
|
|
|
if (Mix_FadeInMusicPos(music, 1, 1000, timeToStart) == -1)
|
|
|
{
|
|
|
logGlobal->error("Unable to play music (%s)", Mix_GetError());
|