Browse Source

Fix battle start when hero has tactics and no battle sounds mod is on

Ivan Savenko 2 years ago
parent
commit
a9808a6541
1 changed files with 5 additions and 7 deletions
  1. 5 7
      client/battle/BattleInterface.cpp

+ 5 - 7
client/battle/BattleInterface.cpp

@@ -108,11 +108,14 @@ BattleInterface::BattleInterface(const CCreatureSet *army1, const CCreatureSet *
 		}
 	};
 
-	CCS->soundh->setCallback(battleIntroSoundChannel, onIntroPlayed);
-
 	GH.pushInt(windowObject);
 	windowObject->blockUI(true);
 	windowObject->updateQueue();
+
+	if (battleIntroSoundChannel != -1)
+		CCS->soundh->setCallback(battleIntroSoundChannel, onIntroPlayed);
+	else
+		onIntroSoundPlayed();
 }
 
 void BattleInterface::onIntroSoundPlayed()
@@ -228,11 +231,6 @@ void BattleInterface::stackAttacking( const StackAttackInfo & attackInfo )
 
 void BattleInterface::newRoundFirst( int round )
 {
-	if (battleIntroSoundChannel == -1 &&
-		getAnimationCondition(EAnimationEvents::OPENING) == true)
-	{
-		onIntroSoundPlayed();
-	}
 	waitForAnimationCondition(EAnimationEvents::OPENING, false);
 }