1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 09:22:42 +01:00

Fix #14498: Crash when cloning aircraft with no orders. (#14499)

This commit is contained in:
Peter Nelson
2025-08-05 20:08:23 +01:00
committed by GitHub
parent 8c58fb1efd
commit b0f247df23

View File

@@ -1414,11 +1414,10 @@ CommandCost CmdModifyOrder(DoCommandFlags flags, VehicleID veh, VehicleOrderID s
*/
static bool CheckAircraftOrderDistance(const Aircraft *v_new, const Vehicle *v_order)
{
assert(v_order->orders != nullptr);
const OrderList &orderlist = *v_order->orders;
if (v_new->acache.cached_max_range == 0) return true;
if (orderlist.GetNumOrders() == 0) return true;
if (v_order->GetNumOrders() == 0) return true;
const OrderList &orderlist = *v_order->orders;
auto orders = orderlist.GetOrders();
/* Iterate over all orders to check the distance between all