Browse Source

Fix possible crash on starting 2nd battle while intro sound from 1st one
is still playing

Ivan Savenko 1 year ago
parent
commit
a1f34e059a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      client/battle/BattleInterface.cpp

+ 2 - 1
client/battle/BattleInterface.cpp

@@ -107,7 +107,8 @@ void BattleInterface::playIntroSoundAndUnlockInterface()
 {
 	auto onIntroPlayed = [this]()
 	{
-		if(LOCPLINT->battleInt)
+		// Make sure that battle have not ended while intro was playing AND that a different one has not started
+		if(LOCPLINT->battleInt.get() == this)
 			onIntroSoundPlayed();
 	};