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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user