mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
Few more H3 data validation checks
This commit is contained in:
@ -256,16 +256,16 @@ int main(int argc, char * argv[])
|
|||||||
logGlobal->debug("settings = %s", settings.toJsonNode().toJson());
|
logGlobal->debug("settings = %s", settings.toJsonNode().toJson());
|
||||||
|
|
||||||
// Some basic data validation to produce better error messages in cases of incorrect install
|
// Some basic data validation to produce better error messages in cases of incorrect install
|
||||||
auto testFile = [](std::string filename, std::string message) -> bool
|
auto testFile = [](std::string filename, std::string message)
|
||||||
{
|
{
|
||||||
if (CResourceHandler::get()->existsResource(ResourceID(filename)))
|
if (!CResourceHandler::get()->existsResource(ResourceID(filename)))
|
||||||
return true;
|
|
||||||
|
|
||||||
handleFatalError(message, false);
|
handleFatalError(message, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
testFile("DATA/HELP.TXT", "VCMI requires Heroes III: Shadow of Death or Heroes III: Complete data files to run!");
|
testFile("DATA/HELP.TXT", "VCMI requires Heroes III: Shadow of Death or Heroes III: Complete data files to run!");
|
||||||
testFile("MODS/VCMI/MOD.JSON", "VCMI installation is corrupted! Built-in mod was not found!");
|
testFile("MODS/VCMI/MOD.JSON", "VCMI installation is corrupted! Built-in mod was not found!");
|
||||||
|
testFile("DATA/PLAYERS.PAL", "Heroes III data files are missing or corruped! Please reinstall them.");
|
||||||
|
testFile("SPRITES/DEFAULT.DEF", "Heroes III data files are missing or corruped! Please reinstall them.");
|
||||||
testFile("DATA/TENTCOLR.TXT", "Heroes III: Restoration of Erathia (including HD Edition) data files are not supported!");
|
testFile("DATA/TENTCOLR.TXT", "Heroes III: Restoration of Erathia (including HD Edition) data files are not supported!");
|
||||||
|
|
||||||
srand ( (unsigned int)time(nullptr) );
|
srand ( (unsigned int)time(nullptr) );
|
||||||
|
Reference in New Issue
Block a user