diff --git a/client/battle/BattleInterface.cpp b/client/battle/BattleInterface.cpp index 94dc2a507..3d08ab685 100644 --- a/client/battle/BattleInterface.cpp +++ b/client/battle/BattleInterface.cpp @@ -104,12 +104,7 @@ BattleInterface::BattleInterface(const CCreatureSet *army1, const CCreatureSet * if(LOCPLINT->battleInt) { boost::unique_lock un(*CPlayerInterface::pim); - CCS->musich->playMusicFromSet("battle", true, true); - setAnimationCondition(EAnimationEvents::OPENING, false); - if(tacticsMode) - tacticNextStack(nullptr); - activateStack(); - battleIntroSoundChannel = -1; + onIntroSoundPlayed(); } }; @@ -120,6 +115,16 @@ BattleInterface::BattleInterface(const CCreatureSet *army1, const CCreatureSet * windowObject->updateQueue(); } +void BattleInterface::onIntroSoundPlayed() +{ + setAnimationCondition(EAnimationEvents::OPENING, false); + CCS->musich->playMusicFromSet("battle", true, true); + if(tacticsMode) + tacticNextStack(nullptr); + activateStack(); + battleIntroSoundChannel = -1; +} + BattleInterface::~BattleInterface() { CPlayerInterface::battleInt = nullptr; @@ -223,6 +228,11 @@ void BattleInterface::stackAttacking( const StackAttackInfo & attackInfo ) void BattleInterface::newRoundFirst( int round ) { + if (battleIntroSoundChannel == -1 && + getAnimationCondition(EAnimationEvents::OPENING) == true) + { + onIntroSoundPlayed(); + } waitForAnimationCondition(EAnimationEvents::OPENING, false); } diff --git a/client/battle/BattleInterface.h b/client/battle/BattleInterface.h index 56d969cdd..394ed3b9c 100644 --- a/client/battle/BattleInterface.h +++ b/client/battle/BattleInterface.h @@ -113,6 +113,7 @@ class BattleInterface /// defender interface, not null if attacker is human in our vcmiclient std::shared_ptr defenderInt; + void onIntroSoundPlayed(); public: /// copy of initial armies (for result window) const CCreatureSet *army1;