diff options
author | rubidium <rubidium@openttd.org> | 2008-04-13 16:54:19 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-04-13 16:54:19 +0000 |
commit | e8ee93b5938642bb25e0a5e349d9ce4c7c071960 (patch) | |
tree | c86cfde879096a6a1bcd92d313e174e9a965cc68 /src/order_cmd.cpp | |
parent | 145ea544749580b0390b4b69b6e3772995d51502 (diff) | |
download | openttd-e8ee93b5938642bb25e0a5e349d9ce4c7c071960.tar.xz |
(svn r12689) -Feature: non-stop(or rather no non-stop) and via orders for road vehicles.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r-- | src/order_cmd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 64e235ce6..1929760c3 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -358,7 +358,7 @@ CommandCost CmdInsertOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) } /* Non stop not allowed for non-trains. */ - if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR; + if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN && v->type != VEH_ROAD) return CMD_ERROR; /* Full load and unload are mutual exclusive. */ if ((new_order.GetLoadType() & OLFB_FULL_LOAD) && (new_order.GetUnloadType() & OUFB_UNLOAD)) return CMD_ERROR; @@ -412,7 +412,7 @@ CommandCost CmdInsertOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) if (!IsPlayerBuildableVehicleType(v)) return CMD_ERROR; } - if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN) return CMD_ERROR; + if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN && v->type != VEH_ROAD) return CMD_ERROR; if (new_order.GetDepotOrderType() & ~ODTFB_PART_OF_ORDERS) return CMD_ERROR; if (new_order.GetDepotActionType() & ~ODATFB_NEAREST_DEPOT) return CMD_ERROR; break; @@ -869,6 +869,7 @@ CommandCost CmdModifyOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) default: NOT_REACHED(); case MOF_NON_STOP: + if (v->type != VEH_TRAIN && v->type != VEH_ROAD) return CMD_ERROR; if (data >= ONSF_END) return CMD_ERROR; if (data == order->GetNonStopType()) return CMD_ERROR; break; |