Quellcode durchsuchen

Fix possible unprotected access to battleint

Ivan Savenko vor 2 Jahren
Ursprung
Commit
3eb19e6ed7
1 geänderte Dateien mit 1 neuen und 3 gelöschten Zeilen
  1. 1 3
      client/battle/BattleInterface.cpp

+ 1 - 3
client/battle/BattleInterface.cpp

@@ -105,11 +105,9 @@ void BattleInterface::playIntroSoundAndUnlockInterface()
 {
 {
 	auto onIntroPlayed = [this]()
 	auto onIntroPlayed = [this]()
 	{
 	{
+		boost::unique_lock<boost::recursive_mutex> un(*CPlayerInterface::pim);
 		if(LOCPLINT->battleInt)
 		if(LOCPLINT->battleInt)
-		{
-			boost::unique_lock<boost::recursive_mutex> un(*CPlayerInterface::pim);
 			onIntroSoundPlayed();
 			onIntroSoundPlayed();
-		}
 	};
 	};
 
 
 	int battleIntroSoundChannel = CCS->soundh->playSoundFromSet(CCS->soundh->battleIntroSounds);
 	int battleIntroSoundChannel = CCS->soundh->playSoundFromSet(CCS->soundh->battleIntroSounds);