Fix: Autorenew failure advice due to bad refit being shown to all companies

This commit is contained in:
Jonathan G Rennison
2021-02-16 18:14:40 +00:00
parent 0d385c9688
commit 5cd3136170

View File

@@ -324,6 +324,8 @@ static CommandCost BuildReplacementVehicle(Vehicle *old_veh, Vehicle **new_vehic
/* Does it need to be refitted */ /* Does it need to be refitted */
CargoID refit_cargo = GetNewCargoTypeForReplace(old_veh, e, part_of_chain); CargoID refit_cargo = GetNewCargoTypeForReplace(old_veh, e, part_of_chain);
if (refit_cargo == CT_INVALID) { if (refit_cargo == CT_INVALID) {
if (!IsLocalCompany()) return CommandCost();
SetDParam(0, old_veh->index); SetDParam(0, old_veh->index);
int order_id = GetIncompatibleRefitOrderIdForAutoreplace(old_veh, e); int order_id = GetIncompatibleRefitOrderIdForAutoreplace(old_veh, e);