summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan G Rennison <j.g.rennison@gmail.com>2021-02-18 09:50:33 +0000
committerGitHub <noreply@github.com>2021-02-18 10:50:33 +0100
commite059a88533ac463d802f14c4a25d6c1c69d1c8ea (patch)
tree39604bc852fe546f08c7a87b6ac252622a2cb6cc
parentd5e18feed93f9b99cceb6649e771b6f2aff42715 (diff)
downloadopenttd-e059a88533ac463d802f14c4a25d6c1c69d1c8ea.tar.xz
Fix: Autorenew failure advice due to bad refit being shown to all companies (#8681)
-rw-r--r--src/autoreplace_cmd.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index 5785968cf..b72338021 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -319,6 +319,8 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic
/* Does it need to be refitted */
CargoID refit_cargo = GetNewCargoTypeForReplace(old_veh, e, part_of_chain);
if (refit_cargo == CT_INVALID) {
+ if (!IsLocalCompany()) return CommandCost();
+
SetDParam(0, old_veh->index);
int order_id = GetIncompatibleRefitOrderIdForAutoreplace(old_veh, e);