From 8824130b6609eadc143456314cdd7915f904711f Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sun, 6 Sep 2020 15:22:20 +0100 Subject: [PATCH] Tracerestrict: Allow referencing competitor infra where allowed by sharing --- src/tracerestrict_gui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tracerestrict_gui.cpp b/src/tracerestrict_gui.cpp index b99d0b314e..70987888d4 100644 --- a/src/tracerestrict_gui.cpp +++ b/src/tracerestrict_gui.cpp @@ -44,6 +44,7 @@ #include "table/sprites.h" #include "toolbar_gui.h" #include "core/geometry_func.hpp" +#include "infrastructure_func.h" #include "safeguards.h" @@ -2033,7 +2034,7 @@ public: return; } - if (!IsTileOwner(tile, _local_company)) { + if (!IsInfraTileUsageAllowed(VEH_TRAIN, _local_company, tile)) { ShowErrorMessage(error_message, STR_ERROR_AREA_IS_OWNED_BY_ANOTHER, WL_INFO); return; } @@ -2049,7 +2050,7 @@ public: TraceRestrictItem item = GetSelected(); if (GetTraceRestrictTypeProperties(item).value_type != TRVT_TILE_INDEX) return; - if (!IsTileOwner(tile, _local_company)) { + if (!IsInfraTileUsageAllowed(VEH_TRAIN, _local_company, tile)) { ShowErrorMessage(error_message, STR_ERROR_AREA_IS_OWNED_BY_ANOTHER, WL_INFO); return; }