diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index cf7311622a..894c346fb5 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -915,9 +915,6 @@ char *GRFBuildParamList(char *dst, const GRFConfig *c, const char *last) return dst; } -/** Base GRF ID for OpenTTD's base graphics GRFs. */ -static const uint32 OPENTTD_GRAPHICS_BASE_GRF_ID = BSWAP32(0xFF4F5400); - /** * Search a textfile file next to this NewGRF. * @param type The type of the textfile to search for. diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 288faf2373..b89790e8ea 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -780,6 +780,11 @@ bool AfterLoadGame() assert(_tick_skip_counter < _settings_game.economy.day_length_factor); } + /* Set day length factor to 1 if loading a pre day length savegame */ + if (SlXvIsFeatureMissing(XSLFI_VARIABLE_DAY_LENGTH) && SlXvIsFeatureMissing(XSLFI_SPRINGPP)) { + _settings_game.economy.day_length_factor = 1; + } + /* Update current year * must be done before loading sprites as some newgrfs check it */ SetDate(_date, _date_fract); @@ -3376,6 +3381,11 @@ bool AfterLoadGame() _settings_game.economy.town_cargo_scale_factor = _settings_game.economy.old_town_cargo_factor * 10; } + /* Set day length factor to 1 if loading a pre day length savegame */ + if (SlXvIsFeatureMissing(XSLFI_VARIABLE_DAY_LENGTH) && SlXvIsFeatureMissing(XSLFI_SPRINGPP)) { + _settings_game.economy.day_length_factor = 1; + } + /* Road stops is 'only' updating some caches */ AfterLoadRoadStops(); AfterLoadLabelMaps(); diff --git a/src/saveload/extended_ver_sl.cpp b/src/saveload/extended_ver_sl.cpp index 8384f95857..5b11a856f4 100644 --- a/src/saveload/extended_ver_sl.cpp +++ b/src/saveload/extended_ver_sl.cpp @@ -137,6 +137,7 @@ void SlXvResetState() { _sl_is_ext_version = false; _sl_is_faked_ext = false; + _sl_xv_discardable_chunk_ids.clear(); memset(_sl_xv_feature_versions, 0, sizeof(_sl_xv_feature_versions)); } diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index dee5be33a2..4f23576d0d 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -327,6 +327,10 @@ static void SwapPackets(GoodsEntry *ge) static void Load_STNS() { + _cargo_source_xy = 0; + _cargo_days = 0; + _cargo_feeder_share = 0; + int index; while ((index = SlIterateArray()) != -1) { Station *st = new (index) Station(); @@ -519,8 +523,9 @@ static void Save_STNN() static void Load_STNN() { - int index; + _num_flows = 0; + int index; while ((index = SlIterateArray()) != -1) { bool waypoint = (SlReadByte() & FACIL_WAYPOINT) != 0;