(svn r10514) -Codechange: add support for getting the nearest industry with a given type.

This commit is contained in:
rubidium
2007-07-11 22:57:47 +00:00
parent 1aaab031b2
commit 57268fa7e3
4 changed files with 42 additions and 6 deletions

View File

@@ -44,6 +44,7 @@
#include "table/build_industry.h"
#include "newgrf_commons.h"
#include "newgrf_townname.h"
#include "newgrf_industries.h"
/* TTDPatch extended GRF format codec
* (c) Petr Baudis 2004 (GPL'd)
@@ -5228,6 +5229,15 @@ 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.