diff options
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r-- | src/order_gui.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp index abfe792dd..167c754f0 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -309,8 +309,7 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile) } // not found - order.type = OT_NOTHING; - order.flags = 0; + order.Free(); order.dest = INVALID_STATION; return order; } @@ -347,7 +346,7 @@ static void OrdersPlaceObj(const Vehicle *v, TileIndex tile, Window *w) if (u != NULL && HandleOrderVehClick(v, u, w)) return; cmd = GetOrderCmdFromTile(v, tile); - if (cmd.type == OT_NOTHING) return; + if (!cmd.IsValid()) return; if (DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), PackOrder(&cmd), NULL, CMD_INSERT_ORDER | CMD_MSG(STR_8833_CAN_T_INSERT_NEW_ORDER))) { if (WP(w,order_d).sel != -1) WP(w,order_d).sel++; |