summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saveload.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/saveload.c b/saveload.c
index 8e00bcfcd..5e0988a60 100644
--- a/saveload.c
+++ b/saveload.c
@@ -1290,7 +1290,7 @@ static Thread* save_thread;
*/
static void* SaveFileToDisk(void *arg)
{
- const SaveLoadFormat *fmt = GetSavegameFormat(_savegame_format);
+ const SaveLoadFormat *fmt;
uint32 hdr[2];
if (arg != NULL) OTTD_SendThreadMessage(MSG_OTTD_SAVETHREAD_START);
@@ -1307,6 +1307,8 @@ static void* SaveFileToDisk(void *arg)
return NULL;
}
+ fmt = GetSavegameFormat(_savegame_format);
+
/* We have written our stuff to memory, now write it to file! */
hdr[0] = fmt->tag;
hdr[1] = TO_BE32(SAVEGAME_VERSION << 16);