Return 0 in Engine_SCUMM_create if the game isn't found (instead of computing the MD5 of non-existant files)

svn-id: r17917
This commit is contained in:
Max Horn 2005-05-05 12:03:16 +00:00
parent 28e40b33a7
commit fecc4d5f84

View file

@ -2658,8 +2658,10 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
break;
g++;
}
if (!g->name)
if (!g->name) {
error("Invalid game '%s'\n", detector->_game.name);
return 0;
}
ScummGameSettings game = *g;
@ -2687,15 +2689,21 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
}
strcpy(tempName, detectName);
File f;
bool found = false;
while (substLastIndex != -1) {
if (f.exists(detectName, ConfMan.get("path").c_str()))
if (File::exists(detectName, ConfMan.get("path").c_str())) {
found = true;
break;
}
substLastIndex = generateSubstResFileName_(tempName, detectName, sizeof(detectName), substLastIndex + 1);
}
// Unable to locate game data
if (!found) {
return 0;
}
// Force game to have Mac platform if needed
if (substLastIndex > 0) {
if (substResFileNameTable[substLastIndex].genMethod == kGenMac ||