summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-09-05 10:15:23 +0000
committerbjarni <bjarni@openttd.org>2007-09-05 10:15:23 +0000
commit7cd2aeb1c9a9dbb9918c2a309e353723e0f329da (patch)
tree4c5c8c63ea8fbb514fa7bd1574862c409bf2efdc /src/train_cmd.cpp
parent9e5376fefe2d6fa600014f5d985a4554c4f883f2 (diff)
downloadopenttd-7cd2aeb1c9a9dbb9918c2a309e353723e0f329da.tar.xz
(svn r11045) -Codechange: added a function to tell if a vehicle is the rear part of a dualheaded train engine
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 2981eec40..a709470fc 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -798,7 +798,7 @@ int CheckTrainInDepot(const Vehicle *v, bool needs_to_be_stopped)
* engines with more articulated parts than before works correctly.
*
* Also skip counting rear ends of multiheaded engines */
- if (!IsArticulatedPart(v) && !(!IsTrainEngine(v) && IsMultiheaded(v))) count++;
+ if (!IsArticulatedPart(v) && !IsRearDualheaded(v)) count++;
if (v->u.rail.track != TRACK_BIT_DEPOT || v->tile != tile ||
(IsFrontEngine(v) && needs_to_be_stopped && !(v->vehstatus & VS_STOPPED))) {
return -1;
@@ -953,7 +953,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p
dst_head = NULL;
}
- if (IsMultiheaded(src) && !IsTrainEngine(src)) return_cmd_error(STR_REAR_ENGINE_FOLLOW_FRONT_ERROR);
+ if (IsRearDualheaded(src)) return_cmd_error(STR_REAR_ENGINE_FOLLOW_FRONT_ERROR);
/* when moving all wagons, we can't have the same src_head and dst_head */
if (HASBIT(p2, 0) && src_head == dst_head) return CommandCost();
@@ -1221,7 +1221,7 @@ CommandCost CmdSellRailWagon(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
return_cmd_error(STR_881A_TRAINS_CAN_ONLY_BE_ALTERED);
}
- if (IsMultiheaded(v) && !IsTrainEngine(v)) return_cmd_error(STR_REAR_ENGINE_FOLLOW_FRONT_ERROR);
+ if (IsRearDualheaded(v)) return_cmd_error(STR_REAR_ENGINE_FOLLOW_FRONT_ERROR);
if (flags & DC_EXEC) {
if (v == first && IsFrontEngine(first)) {