1
0
Fork 0

(svn r23254) [1.1] -Backport from trunk:

- Fix: [NewGRF] Run StartupEngines() if NewGRFs changed during loading a savegame, just like it's running when NewGRFs are changed during a game (r23083)
- Fix: Account for snow line table when determining the snow line for building houses (r23082)
- Fix: [NewGRF] If a NewGRF overrides a default house the minimum start year for that house was set to 1930 [FS#4794] (r23059)
- Fix: [NoAI] AIOrder::GetOrderCount() did not hide implicit orders (r23057)
release/1.1
rubidium 2011-11-18 20:52:13 +00:00
parent 68afdc6312
commit 5d9975cad1
5 changed files with 11 additions and 9 deletions

View File

@ -190,7 +190,7 @@ static const Order *ResolveOrder(VehicleID vehicle_id, AIOrder::OrderPosition or
/* static */ int32 AIOrder::GetOrderCount(VehicleID vehicle_id)
{
return AIVehicle::IsValidVehicle(vehicle_id) ? ::Vehicle::Get(vehicle_id)->GetNumOrders() : -1;
return AIVehicle::IsValidVehicle(vehicle_id) ? ::Vehicle::Get(vehicle_id)->GetNumManualOrders() : -1;
}
/* static */ TileIndex AIOrder::GetOrderDestination(VehicleID vehicle_id, OrderPosition order_position)

View File

@ -650,6 +650,10 @@ void StartupOneEngine(Engine *e, Date aging_date)
}
}
/**
* Start/initialise all our engines. Must be called whenever there are changes
* to the NewGRF config.
*/
void StartupEngines()
{
Engine *e;

View File

@ -1679,13 +1679,6 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
housespec->cargo_acceptance[2] = 0;
}
/**
* New houses do not (currently) expect to have a default start
* date before 1930, as this breaks the build date stuff.
* @see FinaliseHouseArray() for more details.
*/
if (housespec->min_year < 1930) housespec->min_year = 1930;
_loaded_newgrf_features.has_newhouses = true;
break;
}

View File

@ -2595,6 +2595,11 @@ bool AfterLoadGame()
}
}
/* When any NewGRF has been changed the availability of some vehicles might
* have been changed too. e->company_avail must be set to 0 in that case
* which is done by StartupEngines(). */
if (gcf_res != GLC_ALL_GOOD) StartupEngines();
/* Road stops is 'only' updating some caches */
AfterLoadRoadStops();
AfterLoadLabelMaps();

View File

@ -2095,7 +2095,7 @@ static bool BuildTownHouse(Town *t, TileIndex tile)
/* Above snow? */
int land = _settings_game.game_creation.landscape;
if (land == LT_ARCTIC && z >= _settings_game.game_creation.snow_line) land = -1;
if (land == LT_ARCTIC && z >= HighestSnowLine()) land = -1;
uint bitmask = (1 << rad) + (1 << (land + 12));