From e28da50c4f4a0408731293519a56ad65e6d426a2 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 30 Jul 2019 19:09:08 +0100 Subject: [PATCH] Fix order destination refcount accounting for shared orders --- src/order_cmd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index b371eba52c..86a533452e 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -63,6 +63,7 @@ void IntialiseOrderDestinationRefcountMap() ClearOrderDestinationRefcountMap(); const Vehicle *v; FOR_ALL_VEHICLES(v) { + if (v != v->FirstShared()) continue; const Order *order; FOR_VEHICLE_ORDERS(v, order) { if (order->IsType(OT_GOTO_STATION) || order->IsType(OT_GOTO_WAYPOINT) || order->IsType(OT_IMPLICIT)) {