diff --git a/ai/default/default.c b/ai/default/default.c index f21a9174a6..f53198e2e9 100644 --- a/ai/default/default.c +++ b/ai/default/default.c @@ -459,7 +459,10 @@ static Town *AiFindRandomTown(void) static Industry *AiFindRandomIndustry(void) { - return GetRandomIndustry(); + int num = RandomRange(GetMaxIndustryIndex()); + if (IsValidIndustry(GetIndustry(num))) return GetIndustry(num); + + return NULL; } static void AiFindSubsidyIndustryRoute(FoundRoute *fr) diff --git a/openttd.c b/openttd.c index c8ef91f688..03edb0d7b4 100644 --- a/openttd.c +++ b/openttd.c @@ -385,6 +385,8 @@ int ttd_main(int argc, char *argv[]) _switch_mode = SM_LOAD; } else { _switch_mode = SM_NEWGAME; + /* Give a random map */ + generation_seed = InteractiveRandom(); } break; case 'G': generation_seed = atoi(mgo.opt); break; @@ -1594,6 +1596,21 @@ bool AfterLoadGame(void) } } + if (CheckSavegameVersion(7)) { + Station *st; + FOR_ALL_STATIONS(st) { + CargoID c; + for (c = 0; c < NUM_CARGO; c++) { + GoodsEntry *ge = &st->goods[c]; + + /* In old versions, enroute_from used 0xFF as INVALID_STATION */ + if (ge->enroute_from == 0xFF) { + ge->enroute_from = INVALID_STATION; + } + } + } + } + return true; } diff --git a/station_cmd.c b/station_cmd.c index 2201e61f96..d4a1ad89ee 100644 --- a/station_cmd.c +++ b/station_cmd.c @@ -3064,11 +3064,6 @@ static void SaveLoad_STNS(Station *st) SlObject(st, _station_desc); for (i = 0; i != NUM_CARGO; i++) { SlObject(&st->goods[i], _goods_desc); - - /* In older versions, enroute_from had 0xFF as INVALID_STATION, is now 0xFFFF */ - if (CheckSavegameVersion(7) && st->goods[i].enroute_from == 0xFF) { - st->goods[i].enroute_from = INVALID_STATION; - } } if (st->num_specs != 0) { diff --git a/table/engines.h b/table/engines.h index 40389082af..36659ffc46 100644 --- a/table/engines.h +++ b/table/engines.h @@ -555,9 +555,9 @@ const AircraftVehicleInfo orig_aircraft_vehicle_info[NUM_AIRCRAFT_ENGINES] = { AVI( 4, 26, 210, J, SND_09_JET, 40, 74, 20, 220 ), /* 21 */ AVI( 6, 16, 125, P, SND_09_JET, 50, 74, 10, 80 ), /* 22 */ AVI( 2, 17, 145, P, SND_09_JET, 40, 74, 10, 85 ), /* 23 */ - AVI( 11, 16, 130, J, SND_09_JET, 40, 74, 10, 75 ), /* 24 */ - AVI( 10, 16, 149, J, SND_09_JET, 40, 74, 10, 85 ), /* 25 */ - AVI( 15, 17, 170, J, SND_09_JET, 40, 74, 18, 65 ), /* 26 */ + AVI( 11, 16, 130, P, SND_09_JET, 40, 74, 10, 75 ), /* 24 */ + AVI( 10, 16, 149, P, SND_09_JET, 40, 74, 10, 85 ), /* 25 */ + AVI( 15, 17, 170, P, SND_09_JET, 40, 74, 18, 65 ), /* 26 */ AVI( 12, 18, 210, J, SND_09_JET, 40, 74, 25, 110 ), /* 27 */ AVI( 13, 20, 230, J, SND_09_JET, 40, 74, 60, 180 ), /* 28 */ AVI( 14, 21, 220, J, SND_09_JET, 40, 74, 65, 150 ), /* 29 */