summaryrefslogtreecommitdiff
path: root/src/saveload.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-05-05 22:03:01 +0000
committersmatz <smatz@openttd.org>2008-05-05 22:03:01 +0000
commit2e0ec7600714ccdc64a3df55c71dcdf749f6d19d (patch)
tree3bfbac1c842ff33c65b27d14c0bcca4882d02a9d /src/saveload.cpp
parentf2683a603715c16e1fa8a4ab321d52a5d63ef251 (diff)
downloadopenttd-2e0ec7600714ccdc64a3df55c71dcdf749f6d19d.tar.xz
(svn r12961) -Codechange: store the type of savegame we are loading in a global variable
Diffstat (limited to 'src/saveload.cpp')
-rw-r--r--src/saveload.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/saveload.cpp b/src/saveload.cpp
index f6edcf578..ff2c4b3fb 100644
--- a/src/saveload.cpp
+++ b/src/saveload.cpp
@@ -35,6 +35,10 @@
#include "table/strings.h"
extern const uint16 SAVEGAME_VERSION = 95;
+
+SavegameType _savegame_type; ///< type of savegame we are loading
+
+uint32 _ttdp_version; ///< version of TTDP savegame (if applicable)
uint16 _sl_version; ///< the major savegame version identifier
byte _sl_minor_version; ///< the minor savegame version, DO NOT USE!
@@ -1632,6 +1636,7 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb)
InitializeGame(IG_DATE_RESET, 256, 256); // set a mapsize of 256x256 for TTDPatch games or it might get confused
if (!LoadOldSaveGame(filename)) return SL_REINIT;
_sl_version = 0;
+ _sl_minor_version = 0;
if (!AfterLoadGame()) return SL_REINIT;
return SL_OK;
}
@@ -1747,6 +1752,8 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb)
fmt->uninit_read();
fclose(_sl.fh);
+ _savegame_type = SGT_OTTD;
+
/* After loading fix up savegame for any internal changes that
* might've occured since then. If it fails, load back the old game */
if (!AfterLoadGame()) return SL_REINIT;