summaryrefslogtreecommitdiff
path: root/src/order_cmd.cpp
diff options
context:
space:
mode:
authorterkhen <terkhen@openttd.org>2010-12-14 21:26:03 +0000
committerterkhen <terkhen@openttd.org>2010-12-14 21:26:03 +0000
commit79e2b3153d4d89a653a72e07727e58300b435ac4 (patch)
tree62d1f676a9a63df00b92b64d8e866a98b080dc3b /src/order_cmd.cpp
parent96b98b392ad89e3d1718a7a46a3e41d4eeab61d3 (diff)
downloadopenttd-79e2b3153d4d89a653a72e07727e58300b435ac4.tar.xz
(svn r21516) -Codechange: Add IsGroundVehicle function to the Vehicle class.
Diffstat (limited to 'src/order_cmd.cpp')
-rw-r--r--src/order_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 13bdf2d8c..ba8d51f87 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -485,8 +485,8 @@ CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
if (!CanVehicleUseStation(u, st)) return_cmd_error(STR_ERROR_CAN_T_ADD_ORDER_SHARED);
}
- /* Non stop not allowed for non-trains. */
- if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN && v->type != VEH_ROAD) return CMD_ERROR;
+ /* Non stop only allowed for ground vehicles. */
+ if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && !v->IsGroundVehicle()) return CMD_ERROR;
/* No load and no unload are mutual exclusive. */
if ((new_order.GetLoadType() & OLFB_NO_LOAD) && (new_order.GetUnloadType() & OUFB_NO_UNLOAD)) return CMD_ERROR;
@@ -556,7 +556,7 @@ CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
}
}
- if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && v->type != VEH_TRAIN && v->type != VEH_ROAD) return CMD_ERROR;
+ if (new_order.GetNonStopType() != ONSF_STOP_EVERYWHERE && !v->IsGroundVehicle()) return CMD_ERROR;
if (new_order.GetDepotOrderType() & ~(ODTFB_PART_OF_ORDERS | ((new_order.GetDepotOrderType() & ODTFB_PART_OF_ORDERS) != 0 ? ODTFB_SERVICE : 0))) return CMD_ERROR;
if (new_order.GetDepotActionType() & ~(ODATFB_HALT | ODATFB_NEAREST_DEPOT)) return CMD_ERROR;
if ((new_order.GetDepotOrderType() & ODTFB_SERVICE) && (new_order.GetDepotActionType() & ODATFB_HALT)) return CMD_ERROR;
@@ -973,7 +973,7 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
default: NOT_REACHED();
case MOF_NON_STOP:
- if (v->type != VEH_TRAIN && v->type != VEH_ROAD) return CMD_ERROR;
+ if (!v->IsGroundVehicle()) return CMD_ERROR;
if (data >= ONSF_END) return CMD_ERROR;
if (data == order->GetNonStopType()) return CMD_ERROR;
break;