diff options
author | rubidium <rubidium@openttd.org> | 2007-06-17 20:09:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-06-17 20:09:05 +0000 |
commit | b2799961bc03e322047220daccf1ebd29f730150 (patch) | |
tree | e60387db30bc84b11507bfeb6daedb9d4dd75afe /src/fileio.cpp | |
parent | 6d9393cb60957b0bd5ba5ca5837d28986d0c4dbb (diff) | |
download | openttd-b2799961bc03e322047220daccf1ebd29f730150.tar.xz |
(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>
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r-- | src/fileio.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp index e79f54984..a3f4a89d6 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -279,7 +279,7 @@ FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subd FILE *f = NULL; char buf[MAX_PATH]; - if (subdir == BASE_DIR) { + if (subdir == NO_DIRECTORY) { ttd_strlcpy(buf, filename, lengthof(buf)); } else { snprintf(buf, lengthof(buf), "%s%s%s", _searchpaths[sp], _subdirs[subdir], filename); @@ -301,11 +301,11 @@ FILE *FioFOpenFile(const char *filename, const char *mode, Subdirectory subdir) FILE *f = NULL; Searchpath sp; - assert(subdir < NUM_SUBDIRS); + assert(subdir < NUM_SUBDIRS || subdir == NO_DIRECTORY); FOR_ALL_SEARCHPATHS(sp) { f = FioFOpenFileSp(filename, mode, sp, subdir); - if (f != NULL || subdir == 0) break; + if (f != NULL || subdir == NO_DIRECTORY) break; } return f; |