1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Add system message about mods incompatibility

This commit is contained in:
nordsoft
2022-09-23 15:02:19 +04:00
parent 2b0f02c832
commit e74890c4b1
11 changed files with 95 additions and 24 deletions

View File

@@ -2967,7 +2967,7 @@ void CGameHandler::save(const std::string & filename)
}
}
void CGameHandler::load(const std::string & filename)
bool CGameHandler::load(const std::string & filename)
{
logGlobal->info("Loading from %s", filename);
const auto stem = FileInfo::GetPathStem(filename);
@@ -2984,12 +2984,20 @@ void CGameHandler::load(const std::string & filename)
}
logGlobal->info("Game has been successfully loaded!");
}
catch(std::exception &e)
catch(const CModHandler::Incompatibility & e)
{
logGlobal->error("Failed to load game: %s", e.what());
lobby->announceMessage(e.what());
return false;
}
catch(const std::exception & e)
{
logGlobal->error("Failed to load game: %s", e.what());
return false;
}
gs->preInit(VLC);
gs->updateOnLoad(lobby->si.get());
return true;
}
bool CGameHandler::bulkSplitStack(SlotID slotSrc, ObjectInstanceID srcOwner, si32 howMany)