mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
#994 should not crash anymore.
This commit is contained in:
@@ -2250,19 +2250,26 @@ void CGameHandler::save( const std::string &fname )
|
||||
sendToAllClients(&sg);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
tlog0 << "Serializing game info...\n";
|
||||
CSaveFile save(GVCMIDirs.UserPath + "/Games/" + fname + ".vlgm1");
|
||||
char hlp[8] = "VCMISVG";
|
||||
save << hlp << static_cast<CMapHeader&>(*gs->map) << gs->scenarioOps << *VLC << gs;
|
||||
}
|
||||
{
|
||||
tlog0 << "Serializing game info...\n";
|
||||
CSaveFile save(GVCMIDirs.UserPath + "/Games/" + fname + ".vlgm1");
|
||||
char hlp[8] = "VCMISVG";
|
||||
save << hlp << static_cast<CMapHeader&>(*gs->map) << gs->scenarioOps << *VLC << gs;
|
||||
}
|
||||
|
||||
{
|
||||
tlog0 << "Serializing server info...\n";
|
||||
CSaveFile save(GVCMIDirs.UserPath + "/Games/" + fname + ".vsgm1");
|
||||
save << *this;
|
||||
{
|
||||
tlog0 << "Serializing server info...\n";
|
||||
CSaveFile save(GVCMIDirs.UserPath + "/Games/" + fname + ".vsgm1");
|
||||
save << *this;
|
||||
}
|
||||
tlog0 << "Game has been successfully saved!\n";
|
||||
}
|
||||
catch(std::exception &e)
|
||||
{
|
||||
tlog1 << "Failed to save game: " << e.what() << std::endl;
|
||||
}
|
||||
tlog0 << "Game has been successfully saved!\n";
|
||||
}
|
||||
|
||||
void CGameHandler::close()
|
||||
|
||||
Reference in New Issue
Block a user