diff options
author | rubidium <rubidium@openttd.org> | 2007-07-11 22:57:47 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-11 22:57:47 +0000 |
commit | 57268fa7e3c67ed1aec21bb935e271c56e430009 (patch) | |
tree | dcbc4478242b9fde2612b63327a2a76bf9fb46a2 /src/newgrf.cpp | |
parent | 1aaab031b203b25746bead8fc5cf01f62b01a10a (diff) | |
download | openttd-57268fa7e3c67ed1aec21bb935e271c56e430009.tar.xz |
(svn r10514) -Codechange: add support for getting the nearest industry with a given type.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index f7bce1cb9..7afed1eea 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -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. |