浏览代码

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

Ivan Savenko 1 年之前
父节点
当前提交
a1f34e059a
共有 1 个文件被更改,包括 2 次插入1 次删除
  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();
 	};