From ab8382c0db353d9d1ba6b7a9690d56aa2415258c Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 12 Jan 2008 19:58:06 +0000 Subject: (svn r11822) -Codechange: Replaced fixed size custom name array. Names are now attached to their object directly and there is no limit to the amount of names. -Fix: NewGRF engines could not be renamed. --- src/saveload.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/saveload.cpp') diff --git a/src/saveload.cpp b/src/saveload.cpp index 9970c6458..ee95c6ac1 100644 --- a/src/saveload.cpp +++ b/src/saveload.cpp @@ -33,7 +33,7 @@ #include "autoreplace_base.h" #include -extern const uint16 SAVEGAME_VERSION = 83; +extern const uint16 SAVEGAME_VERSION = 84; uint16 _sl_version; ///< the major savegame version identifier byte _sl_minor_version; ///< the minor savegame version, DO NOT USE! @@ -434,6 +434,7 @@ void WriteValue(void *ptr, VarType conv, int64 val) case SLE_VAR_U32: *(uint32*)ptr = val; break; case SLE_VAR_I64: *(int64 *)ptr = val; break; case SLE_VAR_U64: *(uint64*)ptr = val; break; + case SLE_VAR_NAME: *(char**)ptr = CopyFromOldName(val); break; case SLE_VAR_NULL: break; default: NOT_REACHED(); } @@ -922,6 +923,9 @@ static void SlSaveChunk(const ChunkHandler *ch) { ChunkSaveLoadProc *proc = ch->save_proc; + /* Don't save any chunk information if there is no save handler. */ + if (proc == NULL) return; + SlWriteUint32(ch->id); DEBUG(sl, 2, "Saving chunk %c%c%c%c", ch->id >> 24, ch->id >> 16, ch->id >> 8, ch->id); -- cgit v1.2.3-54-g00ecf