summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorPavel Stupnikov <dp@dpointer.org>2020-12-22 16:29:48 +0300
committerGitHub <noreply@github.com>2020-12-22 14:29:48 +0100
commit9a45a0f535e312cd97db12c3a2ec1068fa381136 (patch)
treeeb4f235933ea178c370c04c9b12cd00b005f4644 /src/station_cmd.cpp
parentb7751c483e5545aa683baf0b9f09a0add34cfefd (diff)
downloadopenttd-9a45a0f535e312cd97db12c3a2ec1068fa381136.tar.xz
Feature: Set exclusive access to industry from GS (#8115)
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 7bce21353..cd56dcb69 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -4013,7 +4013,7 @@ static bool CanMoveGoodsToStation(const Station *st, CargoID type)
return true;
}
-uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, SourceID source_id, const StationList *all_stations)
+uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, SourceID source_id, const StationList *all_stations, Owner exclusivity)
{
/* Return if nothing to do. Also the rounding below fails for 0. */
if (all_stations->empty()) return 0;
@@ -4024,6 +4024,7 @@ uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, Sourc
std::vector<StationInfo> used_stations;
for (Station *st : *all_stations) {
+ if (exclusivity != INVALID_OWNER && exclusivity != st->owner) continue;
if (!CanMoveGoodsToStation(st, type)) continue;
/* Avoid allocating a vector if there is only one station to significantly