diff options
author | rubidium <rubidium@openttd.org> | 2007-07-01 19:24:54 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-01 19:24:54 +0000 |
commit | 90f85c957ad8e8d2dfd23535701b3079fc2d2718 (patch) | |
tree | fb5afab9eaa026a83642f983053acfabe1d9f492 /src/train_cmd.cpp | |
parent | 83a880c882992efb1b949b26ac881abc3825964f (diff) | |
download | openttd-90f85c957ad8e8d2dfd23535701b3079fc2d2718.tar.xz |
(svn r10409) -Codechange: replace (Aircraft|RoadVeh|Ship|Train)_Tick with a Tick method in the Vehicle class.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 3102d2e55..283e43332 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -3305,24 +3305,24 @@ static void TrainLocoHandler(Vehicle *v, bool mode) } -void Train_Tick(Vehicle *v) +void Train::Tick() { - if (_age_cargo_skip_counter == 0) v->cargo.AgeCargo(); + if (_age_cargo_skip_counter == 0) this->cargo.AgeCargo(); - v->tick_counter++; + this->tick_counter++; - if (IsFrontEngine(v)) { - v->current_order_time++; + if (IsFrontEngine(this)) { + this->current_order_time++; - TrainLocoHandler(v, false); + TrainLocoHandler(this, false); /* make sure vehicle wasn't deleted. */ - if (v->type == VEH_TRAIN && IsFrontEngine(v)) - TrainLocoHandler(v, true); - } else if (IsFreeWagon(v) && HASBITS(v->vehstatus, VS_CRASHED)) { + if (this->type == VEH_TRAIN && IsFrontEngine(this)) + TrainLocoHandler(this, true); + } else if (IsFreeWagon(this) && HASBITS(this->vehstatus, VS_CRASHED)) { /* Delete flooded standalone wagon */ - if (++v->u.rail.crash_anim_pos >= 4400) - DeleteVehicle(v); + if (++this->u.rail.crash_anim_pos >= 4400) + DeleteVehicle(this); } } |