1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Fixed single map victory crash

This commit is contained in:
Dydzio
2019-03-29 22:01:51 +01:00
parent ec536e613c
commit 97869fc36f
4 changed files with 10 additions and 2 deletions

View File

@ -2467,12 +2467,16 @@ void CPlayerInterface::showShipyardDialogOrProblemPopup(const IShipyard *obj)
void CPlayerInterface::requestReturningToMainMenu(bool won)
{
CSH->state = EClientState::DISCONNECTING;
CCS->soundh->ambientStopAllChannels();
if(won && cb->getStartInfo()->campState)
{
CSH->state = EClientState::DISCONNECTING; // do not close server, it's not intended for campaign continuation
CSH->startCampaignScenario(cb->getStartInfo()->campState);
}
else
{
sendCustomEvent(EUserEvent::RETURN_TO_MAIN_MENU);
}
}
void CPlayerInterface::sendCustomEvent( int code )