diff options
author | alberth <alberth@openttd.org> | 2016-09-04 12:47:39 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2016-09-04 12:47:39 +0000 |
commit | c6ac071619ca22c46593e2a0dc6b449c8375ef66 (patch) | |
tree | ccc0177c9c1ae47a4e0043b644a5f0dba38cd21a /src/saveload/saveload.cpp | |
parent | 2fa0fdb1768f45ffaf4fe14fbdbdb73d501d6c36 (diff) | |
download | openttd-c6ac071619ca22c46593e2a0dc6b449c8375ef66.tar.xz |
(svn r27639) -Codechange: Also always set the abstract FileToSaveLoad::filetype when setting a mode.
Diffstat (limited to 'src/saveload/saveload.cpp')
-rw-r--r-- | src/saveload/saveload.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index 007b22f01..a0d15938a 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -2893,7 +2893,7 @@ void GenerateDefaultSaveName(char *buf, const char *last) } /** - * Set the mode of the file to save or load based on the type of file entry at the file system. + * Set the mode and file type of the file to save or load based on the type of file entry at the file system. * @param ft Type of file entry of the file system. */ void FileToSaveLoad::SetMode(FiosType ft) @@ -2923,6 +2923,31 @@ void FileToSaveLoad::SetMode(FiosType ft) this->mode = SL_INVALID; break; } + + switch (ft) { + case FIOS_TYPE_OLDFILE: + case FIOS_TYPE_FILE: + this->filetype = FT_SAVEGAME; + break; + + case FIOS_TYPE_OLD_SCENARIO: + case FIOS_TYPE_SCENARIO: + this->filetype = FT_SCENARIO; + break; + +#ifdef WITH_PNG + case FIOS_TYPE_PNG: + /* FALL THROUGH */ +#endif /* WITH_PNG */ + + case FIOS_TYPE_BMP: + this->filetype = FT_HEIGHTMAP; + break; + + default: + this->filetype = FT_INVALID; + break; + } } #if 0 |