summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-22 21:19:39 +0000
committerrubidium <rubidium@openttd.org>2010-12-22 21:19:39 +0000
commite9a595bda04e169a4a730ad2715363349fb73021 (patch)
treed8f24bfc07472601e5cc3c79c86dff5444e4ea84 /src
parenta38a1e7b0dc7984231cfdbde2b0083d0c77caf9b (diff)
downloadopenttd-e9a595bda04e169a4a730ad2715363349fb73021.tar.xz
(svn r21603) -Codechange: no need to assign something to a variable and then test it for NULL when you're never using it again
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();