diff options
author | SamuXarick <43006711+SamuXarick@users.noreply.github.com> | 2020-03-03 20:46:54 +0000 |
---|---|---|
committer | glx22 <glx22@users.noreply.github.com> | 2020-03-14 23:23:33 +0100 |
commit | 424770d6623d5accf2edfd7a99980ada8dc28ae7 (patch) | |
tree | 550f8f79470fdff0addd2890c694dc97ab1c21d3 /src/script/api | |
parent | 971201b3b7877028140863304a0e8dd63f7e4df8 (diff) | |
download | openttd-424770d6623d5accf2edfd7a99980ada8dc28ae7.tar.xz |
Fix: [AI/GS] Consider neutral station setting when creating tile lists
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/script_tilelist.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/api/script_tilelist.cpp b/src/script/api/script_tilelist.cpp index b9a2ed529..7f4e3ca5c 100644 --- a/src/script/api/script_tilelist.cpp +++ b/src/script/api/script_tilelist.cpp @@ -79,6 +79,9 @@ ScriptTileList_IndustryAccepting::ScriptTileList_IndustryAccepting(IndustryID in const Industry *i = ::Industry::Get(industry_id); + /* Check if this industry is only served by its neutral station */ + if (i->neutral_station != nullptr && !_settings_game.station.serve_neutral_industries) return; + /* Check if this industry accepts anything */ { bool cargo_accepts = false; @@ -116,6 +119,9 @@ ScriptTileList_IndustryProducing::ScriptTileList_IndustryProducing(IndustryID in const Industry *i = ::Industry::Get(industry_id); + /* Check if this industry is only served by its neutral station */ + if (i->neutral_station != nullptr && !_settings_game.station.serve_neutral_industries) return; + /* Check if this industry produces anything */ bool cargo_produces = false; for (byte j = 0; j < lengthof(i->produced_cargo); j++) { |