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:
parent
28e40b33a7
commit
fecc4d5f84
1 changed files with 12 additions and 4 deletions
|
@ -2658,8 +2658,10 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
|
||||||
break;
|
break;
|
||||||
g++;
|
g++;
|
||||||
}
|
}
|
||||||
if (!g->name)
|
if (!g->name) {
|
||||||
error("Invalid game '%s'\n", detector->_game.name);
|
error("Invalid game '%s'\n", detector->_game.name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ScummGameSettings game = *g;
|
ScummGameSettings game = *g;
|
||||||
|
|
||||||
|
@ -2687,14 +2689,20 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
|
||||||
}
|
}
|
||||||
strcpy(tempName, detectName);
|
strcpy(tempName, detectName);
|
||||||
|
|
||||||
File f;
|
bool found = false;
|
||||||
|
|
||||||
while (substLastIndex != -1) {
|
while (substLastIndex != -1) {
|
||||||
if (f.exists(detectName, ConfMan.get("path").c_str()))
|
if (File::exists(detectName, ConfMan.get("path").c_str())) {
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
substLastIndex = generateSubstResFileName_(tempName, detectName, sizeof(detectName), substLastIndex + 1);
|
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
|
// Force game to have Mac platform if needed
|
||||||
if (substLastIndex > 0) {
|
if (substLastIndex > 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue