summaryrefslogtreecommitdiff
path: root/src/saveload
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2012-01-16 22:29:25 +0000
committeryexo <yexo@openttd.org>2012-01-16 22:29:25 +0000
commit2c998051173484aeac026de21a50177313908d37 (patch)
tree4f9ce66ed13db21ea3848341f894b3f9882752f5 /src/saveload
parent358b3e41b25ec207af0652895545a10be9be5811 (diff)
downloadopenttd-2c998051173484aeac026de21a50177313908d37.tar.xz
(svn r23816) -Fix (r23635, r23805): make SCC_ENCODED the first entry in the StringControlCode enum since it's value is not allowed to change
Diffstat (limited to 'src/saveload')
-rw-r--r--src/saveload/saveload.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 92b222d69..8a012b233 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -232,8 +232,9 @@
* 166 23415
* 167 23504
* 168 23637
+ * 169 23816
*/
-extern const uint16 SAVEGAME_VERSION = 168; ///< Current savegame version of OpenTTD.
+extern const uint16 SAVEGAME_VERSION = 169; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading
@@ -1096,6 +1097,9 @@ static void SlString(void *ptr, size_t length, VarType conv)
StringValidationSettings settings = SVS_REPLACE_WITH_QUESTION_MARK;
if ((conv & SLF_ALLOW_CONTROL) != 0) {
settings = settings | SVS_ALLOW_CONTROL_CODE;
+ if (IsSavegameVersionBefore(169)) {
+ str_fix_scc_encoded((char *)ptr, (char *)ptr + len);
+ }
}
if ((conv & SLF_ALLOW_NEWLINE) != 0) {
settings = settings | SVS_ALLOW_NEWLINE;