From 0160bff57b2d8b6f2e83655a0abc06e84a117217 Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Fri, 15 Mar 2024 14:15:15 +0000 Subject: [PATCH] Fix #12301: Update v->dest_tile when relocating buoys Moving buoys caused current_order to be detected as unchanged, making pathfinders to compute a path to an outdated v->dest_tile. Properly update v->dest_tile before reaching pathfinders. --- src/order_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index ccedb8e31d082..739415c57d71d 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -2197,8 +2197,9 @@ bool ProcessOrders(Vehicle *v) } /* If it is unchanged, keep it. */ - if (order->Equals(v->current_order) && (v->type == VEH_AIRCRAFT || v->dest_tile != 0) && - (v->type != VEH_SHIP || !order->IsType(OT_GOTO_STATION) || Station::Get(order->GetDestination())->ship_station.tile != INVALID_TILE)) { + if (order->Equals(v->current_order) && (v->type == VEH_AIRCRAFT || v->dest_tile != 0) && (v->type != VEH_SHIP || + ((!order->IsType(OT_GOTO_STATION) || Station::Get(order->GetDestination())->ship_station.tile != INVALID_TILE) && + (!order->IsType(OT_GOTO_WAYPOINT) || Waypoint::Get(order->GetDestination())->xy == v->dest_tile)))) { return false; }