From 64ead0b513b103f04d98606a3819b8afceab1830 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 5 Feb 2010 20:22:01 +0000 Subject: (svn r19022) -Fix (r18770): loading old (0.1-ish) savegames failed --- src/saveload/saveload.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/saveload') diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index e41213556..2a457921b 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -1916,7 +1916,17 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, boo fseek(_sl.fh, pos, SEEK_SET); _sl_version = 0; _sl_minor_version = 0; - fmt = _saveload_formats + 1; // LZO + + /* Try to find the LZO savegame format; it uses 'OTTD' as tag. */ + fmt = _saveload_formats; + for (;;) { + if (fmt == endof(_saveload_formats)) { + /* Who removed LZO support? Bad bad boy! */ + NOT_REACHED(); + } + if (fmt->tag == TO_BE32X('OTTD')) break; + fmt++; + } break; } -- cgit v1.2.3-70-g09d2