mirror of https://github.com/OpenTTD/OpenTTD
(svn r9351) [0.5] -Backport from trunk (r9147, r9205, r9251, r9298):
- Fix: when loadin games, enroute_from was updated in the wrong place, causing issues with TTD savegames/scenarios (r9147) - Fix: when you started openttd with '-g' you got the same map every run (r9205) - Fix: use a less CPU-intensive algorithm to find a random industry for the AI to prevent it slowing down the game (r9251) - Fix: A34-1000, Z-Shuttle, and Kelling K1 are now listed as small aircraft (r9298)release/0.5
parent
d2ce2009b5
commit
850f73719f
|
@ -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)
|
||||
|
|
17
openttd.c
17
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue