saveload.c
changeset 2927 15690f1a9bb8
parent 2916 8f1aa489701f
child 2952 6a26eeda9679
child 9956 341e963c63c4
--- a/saveload.c	Sun Jan 29 22:40:51 2006 +0000
+++ b/saveload.c	Sun Jan 29 22:42:17 2006 +0000
@@ -1290,7 +1290,7 @@
  */
 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 @@
 		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);