diff options
author | truelight <truelight@openttd.org> | 2006-08-26 11:06:54 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-26 11:06:54 +0000 |
commit | bd775a243d20362a6d188f902e25a451e34fcd9b (patch) | |
tree | 41adb3e3e7587a0807fb23b15b07928a3c27989a | |
parent | e1b69c4654b1dd52e123a73fe0f292fe814690eb (diff) | |
download | openttd-bd775a243d20362a6d188f902e25a451e34fcd9b.tar.xz |
(svn r6136) -Fix: _cur_year wasn't converting when reading pre-31 savegames, causing nasty desyncs
-Fix: _date, which is a Date, which is int32, was saved as uint32
-rw-r--r-- | misc.c | 4 | ||||
-rw-r--r-- | openttd.c | 1 |
2 files changed, 3 insertions, 2 deletions
@@ -268,8 +268,8 @@ static void Load_NAME(void) } static const SaveLoadGlobVarList _date_desc[] = { - SLEG_CONDVAR(_date, SLE_FILE_U16 | SLE_VAR_U32, 0, 30), - SLEG_CONDVAR(_date, SLE_UINT32, 31, SL_MAX_VERSION), + SLEG_CONDVAR(_date, SLE_FILE_U16 | SLE_VAR_I32, 0, 30), + SLEG_CONDVAR(_date, SLE_INT32, 31, SL_MAX_VERSION), SLEG_VAR(_date_fract, SLE_UINT16), SLEG_VAR(_tick_counter, SLE_UINT16), SLEG_VAR(_vehicle_id_ctr_day, SLE_UINT16), @@ -1454,6 +1454,7 @@ bool AfterLoadGame(void) Vehicle *v; _date += DAYS_TILL_ORIGINAL_BASE_YEAR; + _cur_year += ORIGINAL_BASE_YEAR; FOR_ALL_STATIONS(st) st->build_date += DAYS_TILL_ORIGINAL_BASE_YEAR; FOR_ALL_WAYPOINTS(wp) wp->build_date += DAYS_TILL_ORIGINAL_BASE_YEAR; |