From 7cd2aeb1c9a9dbb9918c2a309e353723e0f329da Mon Sep 17 00:00:00 2001 From: bjarni Date: Wed, 5 Sep 2007 10:15:23 +0000 Subject: (svn r11045) -Codechange: added a function to tell if a vehicle is the rear part of a dualheaded train engine --- src/train_cmd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/train_cmd.cpp') 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)) { -- cgit v1.2.3-70-g09d2