mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fixed possible uncaught exception on starting map
This commit is contained in:
@@ -572,7 +572,16 @@ void CServerHandler::sendRestartGame() const
|
||||
|
||||
void CServerHandler::sendStartGame(bool allowOnlyAI) const
|
||||
{
|
||||
verifyStateBeforeStart(allowOnlyAI ? true : settings["session"]["onlyai"].Bool());
|
||||
try
|
||||
{
|
||||
verifyStateBeforeStart(allowOnlyAI ? true : settings["session"]["onlyai"].Bool());
|
||||
}
|
||||
catch (const std::exception & e)
|
||||
{
|
||||
showServerError( std::string("Unable to start map! Reason: ") + e.what());
|
||||
return;
|
||||
}
|
||||
|
||||
LobbyStartGame lsg;
|
||||
if(client)
|
||||
{
|
||||
@@ -696,7 +705,7 @@ void CServerHandler::startCampaignScenario(std::shared_ptr<CampaignState> cs)
|
||||
});
|
||||
}
|
||||
|
||||
void CServerHandler::showServerError(std::string txt)
|
||||
void CServerHandler::showServerError(std::string txt) const
|
||||
{
|
||||
CInfoWindow::showInfoDialog(txt, {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user