mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fixed music playback on switching between towns
This commit is contained in:
@@ -1206,13 +1206,17 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
|
|||||||
townlist->onSelect = std::bind(&CCastleInterface::townChange, this);
|
townlist->onSelect = std::bind(&CCastleInterface::townChange, this);
|
||||||
|
|
||||||
recreateIcons();
|
recreateIcons();
|
||||||
adventureInt->onAudioPaused();
|
if (!from)
|
||||||
|
adventureInt->onAudioPaused();
|
||||||
CCS->musich->playMusic(town->town->clientInfo.musicTheme, true, false);
|
CCS->musich->playMusic(town->town->clientInfo.musicTheme, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
CCastleInterface::~CCastleInterface()
|
CCastleInterface::~CCastleInterface()
|
||||||
{
|
{
|
||||||
if (adventureInt) // may happen on exiting client with open castle interface
|
// resume map audio if:
|
||||||
|
// adventureInt exists (may happen on exiting client with open castle interface)
|
||||||
|
// castleInt has not been replaced (happens on switching between towns inside castle interface)
|
||||||
|
if (adventureInt && LOCPLINT->castleInt == this)
|
||||||
adventureInt->onAudioResumed();
|
adventureInt->onAudioResumed();
|
||||||
if(LOCPLINT->castleInt == this)
|
if(LOCPLINT->castleInt == this)
|
||||||
LOCPLINT->castleInt = nullptr;
|
LOCPLINT->castleInt = nullptr;
|
||||||
|
Reference in New Issue
Block a user