mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Fix battle start with disabled opening sounds
This commit is contained in:
parent
fa355c3356
commit
da7766e90b
@ -104,12 +104,7 @@ BattleInterface::BattleInterface(const CCreatureSet *army1, const CCreatureSet *
|
|||||||
if(LOCPLINT->battleInt)
|
if(LOCPLINT->battleInt)
|
||||||
{
|
{
|
||||||
boost::unique_lock<boost::recursive_mutex> un(*CPlayerInterface::pim);
|
boost::unique_lock<boost::recursive_mutex> un(*CPlayerInterface::pim);
|
||||||
CCS->musich->playMusicFromSet("battle", true, true);
|
onIntroSoundPlayed();
|
||||||
setAnimationCondition(EAnimationEvents::OPENING, false);
|
|
||||||
if(tacticsMode)
|
|
||||||
tacticNextStack(nullptr);
|
|
||||||
activateStack();
|
|
||||||
battleIntroSoundChannel = -1;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -120,6 +115,16 @@ BattleInterface::BattleInterface(const CCreatureSet *army1, const CCreatureSet *
|
|||||||
windowObject->updateQueue();
|
windowObject->updateQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BattleInterface::onIntroSoundPlayed()
|
||||||
|
{
|
||||||
|
setAnimationCondition(EAnimationEvents::OPENING, false);
|
||||||
|
CCS->musich->playMusicFromSet("battle", true, true);
|
||||||
|
if(tacticsMode)
|
||||||
|
tacticNextStack(nullptr);
|
||||||
|
activateStack();
|
||||||
|
battleIntroSoundChannel = -1;
|
||||||
|
}
|
||||||
|
|
||||||
BattleInterface::~BattleInterface()
|
BattleInterface::~BattleInterface()
|
||||||
{
|
{
|
||||||
CPlayerInterface::battleInt = nullptr;
|
CPlayerInterface::battleInt = nullptr;
|
||||||
@ -223,6 +228,11 @@ void BattleInterface::stackAttacking( const StackAttackInfo & attackInfo )
|
|||||||
|
|
||||||
void BattleInterface::newRoundFirst( int round )
|
void BattleInterface::newRoundFirst( int round )
|
||||||
{
|
{
|
||||||
|
if (battleIntroSoundChannel == -1 &&
|
||||||
|
getAnimationCondition(EAnimationEvents::OPENING) == true)
|
||||||
|
{
|
||||||
|
onIntroSoundPlayed();
|
||||||
|
}
|
||||||
waitForAnimationCondition(EAnimationEvents::OPENING, false);
|
waitForAnimationCondition(EAnimationEvents::OPENING, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +113,7 @@ class BattleInterface
|
|||||||
/// defender interface, not null if attacker is human in our vcmiclient
|
/// defender interface, not null if attacker is human in our vcmiclient
|
||||||
std::shared_ptr<CPlayerInterface> defenderInt;
|
std::shared_ptr<CPlayerInterface> defenderInt;
|
||||||
|
|
||||||
|
void onIntroSoundPlayed();
|
||||||
public:
|
public:
|
||||||
/// copy of initial armies (for result window)
|
/// copy of initial armies (for result window)
|
||||||
const CCreatureSet *army1;
|
const CCreatureSet *army1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user