فهرست منبع

Fix possible unprotected access to battleint

Ivan Savenko 2 سال پیش
والد
کامیت
3eb19e6ed7
1فایلهای تغییر یافته به همراه1 افزوده شده و 3 حذف شده
  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);