summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-05-21 12:06:05 +0000
committerpeter1138 <peter1138@openttd.org>2008-05-21 12:06:05 +0000
commit42f78d2fc3855b0d358197745b0d0ba099ef066c (patch)
tree3464efc29253f5fc621e220954d19cca7ae3d056 /src/train_cmd.cpp
parent41adc28093b5c92343ffe9129c48f8c364e8d88b (diff)
downloadopenttd-42f78d2fc3855b0d358197745b0d0ba099ef066c.tar.xz
(svn r13205) -Codechange: Remove unnecessary code-style-buggering-up macro.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 56bf2a9a7..69ba0f779 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2807,10 +2807,10 @@ static void SetVehicleCrashed(Vehicle *v)
InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
- BEGIN_ENUM_WAGONS(v)
+ for (; v != NULL; v = v->Next()) {
v->vehstatus |= VS_CRASHED;
MarkSingleVehicleDirty(v);
- END_ENUM_WAGONS(v)
+ }
/* must be updated after the train has been marked crashed */
if (crossing != INVALID_TILE) UpdateLevelCrossing(crossing);
@@ -2819,9 +2819,11 @@ static void SetVehicleCrashed(Vehicle *v)
static uint CountPassengersInTrain(const Vehicle *v)
{
uint num = 0;
- BEGIN_ENUM_WAGONS(v)
+
+ for (; v != NULL; v = v->Next()) {
if (IsCargoInClass(v->cargo_type, CC_PASSENGERS)) num += v->cargo.Count();
- END_ENUM_WAGONS(v)
+ }
+
return num;
}
@@ -3651,9 +3653,7 @@ void ConnectMultiheadedTrains()
FOR_ALL_VEHICLES(v) {
if (v->type == VEH_TRAIN && IsFrontEngine(v)) {
- Vehicle *u = v;
-
- BEGIN_ENUM_WAGONS(u) {
+ for (Vehicle *u = v; u != NULL; u = u->Next()) {
if (u->u.rail.other_multiheaded_part != NULL) continue; // we already linked this one
if (IsMultiheaded(u)) {
@@ -3678,7 +3678,7 @@ void ConnectMultiheadedTrains()
ClearMultiheaded(u);
}
}
- } END_ENUM_WAGONS(u)
+ }
}
}
}
@@ -3699,9 +3699,7 @@ void ConvertOldMultiheadToNew()
FOR_ALL_VEHICLES(v) {
if (v->type == VEH_TRAIN) {
if (HasBit(v->subtype, 7) && ((v->subtype & ~0x80) == 0 || (v->subtype & ~0x80) == 4)) {
- Vehicle *u = v;
-
- BEGIN_ENUM_WAGONS(u) {
+ for (Vehicle *u = v; u != NULL; u = u->Next()) {
const RailVehicleInfo *rvi = RailVehInfo(u->engine_type);
ClrBit(u->subtype, 7);
@@ -3740,7 +3738,7 @@ void ConvertOldMultiheadToNew()
break;
default: NOT_REACHED(); break;
}
- } END_ENUM_WAGONS(u)
+ }
}
}
}