1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-21 13:39:09 +00:00

(svn r10188) -Codechange: make it a little easier to load a savegame from the console:

-g <absolute path>
 -g <relative path from current working directory>
 -g <relative path from within the savegame directory>
This commit is contained in:
rubidium
2007-06-17 20:09:05 +00:00
parent 6d9393cb60
commit b2799961bc
4 changed files with 12 additions and 6 deletions

View File

@@ -1584,6 +1584,11 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb)
}
_sl.fh = (mode == SL_SAVE) ? FioFOpenFile(filename, "wb", sb) : FioFOpenFile(filename, "rb", sb);
/* Make it a little easier to load savegames from the console */
if (_sl.fh == NULL && mode == SL_LOAD) _sl.fh = FioFOpenFile(filename, "rb", SAVE_DIR);
if (_sl.fh == NULL && mode == SL_LOAD) _sl.fh = FioFOpenFile(filename, "rb", BASE_DIR);
if (_sl.fh == NULL) {
DEBUG(sl, 0, "Cannot open savegame '%s' for saving/loading.", filename);
return SL_ERROR;