(svn r12587) -Codechange: unduplicate some code in the Unpack*Order functions and move the 'normal' case Pack/Unpack to Order.

This commit is contained in:
rubidium
2008-04-06 07:22:26 +00:00
parent e68b2088ce
commit 8cd1795fe3
7 changed files with 56 additions and 70 deletions

View File

@@ -373,7 +373,7 @@ static void OrdersPlaceObj(const Vehicle *v, TileIndex tile, Window *w)
cmd = GetOrderCmdFromTile(v, tile);
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 (DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), cmd.Pack(), 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++;
ResetObjectToPlace();
}