1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Merge pull request #2889 from Nordsoft91/mod-compatibility-check

Proper mod compatibility check logic
This commit is contained in:
Nordsoft91
2023-09-26 19:29:46 +02:00
committed by GitHub
29 changed files with 282 additions and 152 deletions

View File

@@ -1768,8 +1768,17 @@ bool CGameHandler::load(const std::string & filename)
catch(const ModIncompatibility & e)
{
logGlobal->error("Failed to load game: %s", e.what());
auto errorMsg = VLC->generaltexth->translate("vcmi.server.errors.modsIncompatibility") + '\n';
errorMsg += e.what();
std::string errorMsg;
if(!e.whatMissing().empty())
{
errorMsg += VLC->generaltexth->translate("vcmi.server.errors.modsToEnable") + '\n';
errorMsg += e.whatMissing();
}
if(!e.whatExcessive().empty())
{
errorMsg += VLC->generaltexth->translate("vcmi.server.errors.modsToDisable") + '\n';
errorMsg += e.whatExcessive();
}
lobby->announceMessage(errorMsg);
return false;
}