Fix: Autorenew failure advice due to bad refit being shown to all companies (#8681)

This commit is contained in:
Jonathan G Rennison 2021-02-18 09:50:33 +00:00 committed by GitHub
parent d5e18feed9
commit e059a88533
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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);