summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/order_cmd.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 28f30e811..684ff62c9 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -750,7 +750,6 @@ CommandCost CmdDeleteOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
{
VehicleID veh_id = GB(p1, 0, 20);
VehicleOrderID sel_ord = GB(p2, 0, 8);
- Order *order;
Vehicle *v = Vehicle::GetIfValid(veh_id);
@@ -762,8 +761,7 @@ CommandCost CmdDeleteOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
/* If we did not select an order, we maybe want to de-clone the orders */
if (sel_ord >= v->GetNumOrders()) return DecloneOrder(v, flags);
- order = v->GetOrder(sel_ord);
- if (order == NULL) return CMD_ERROR;
+ if (v->GetOrder(sel_ord) == NULL) return CMD_ERROR;
if (flags & DC_EXEC) DeleteOrder(v, sel_ord);
return CommandCost();