|
@@ -5737,37 +5737,24 @@ static void FinaliseIndustriesArray()
|
|
|
}
|
|
|
|
|
|
for (uint j = 0; j < NUM_INDUSTRYTYPES; j++) {
|
|
|
IndustrySpec *indsp = &_industry_specs[j];
|
|
|
if (indsp->enabled && indsp->grf_prop.grffile != NULL) {
|
|
|
for (uint i = 0; i < 3; i++) {
|
|
|
indsp->conflicting[i] = MapNewGRFIndustryType(indsp->conflicting[i], indsp->grf_prop.grffile->grfid);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/** Each cargo string needs to be mapped from TTDPatch to OpenTTD string IDs.
|
|
|
* This is done after loading so that strings from Action 4 will be mapped
|
|
|
* properly. */
|
|
|
static void MapNewCargoStrings()
|
|
|
{
|
|
|
for (CargoID c = 0; c < NUM_CARGO; c++) {
|
|
|
CargoSpec *cs = &_cargo[c];
|
|
|
/* Don't map if the cargo is unavailable or not from NewGRF */
|
|
|
if (cs->grfid == 0) continue;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/* Here we perform initial decoding of some special sprites (as are they
|
|
|
* described at http://www.ttdpatch.net/src/newgrf.txt, but this is only a very
|
|
|
* partial implementation yet). */
|
|
|
/* XXX: We consider GRF files trusted. It would be trivial to exploit OTTD by
|
|
|
* a crafted invalid GRF file. We should tell that to the user somehow, or
|
|
|
* better make this more robust in the future. */
|
|
|
static void DecodeSpecialSprite(uint num, GrfLoadingStage stage)
|
|
|
{
|
|
|
/* XXX: There is a difference between staged loading in TTDPatch and
|
|
|
* here. In TTDPatch, for some reason actions 1 and 2 are carried out
|
|
|
* during stage 1, whilst action 3 is carried out during stage 2 (to
|
|
|
* "resolve" cargo IDs... wtf). This is a little problem, because cargo
|
|
@@ -5997,28 +5984,24 @@ static void AfterLoadGRFs()
|
|
|
/* Set the block size in the depot windows based on vehicle sprite sizes */
|
|
|
InitDepotWindowBlockSizes();
|
|
|
|
|
|
/* Add all new houses to the house array. */
|
|
|
FinaliseHouseArray();
|
|
|
|
|
|
/* Add all new industries to the industry array. */
|
|
|
FinaliseIndustriesArray();
|
|
|
|
|
|
/* Create dynamic list of industry legends for smallmap_gui.cpp */
|
|
|
BuildIndustriesLegend();
|
|
|
|
|
|
/* Map cargo strings. This is a separate step because cargos are
|
|
|
* loaded before strings... */
|
|
|
MapNewCargoStrings();
|
|
|
|
|
|
/* Update the townname generators list */
|
|
|
InitGRFTownGeneratorNames();
|
|
|
|
|
|
/* Run all queued vehicle list order changes */
|
|
|
CommitVehicleListOrderChanges();
|
|
|
|
|
|
/* Load old shore sprites in new position, if they were replaced by ActionA */
|
|
|
ActivateOldShore();
|
|
|
|
|
|
/* Deallocate temporary loading data */
|
|
|
free(_gted);
|
|
|
_grm_sprites.clear();
|