summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2009-01-23 20:53:43 +0000
committerpeter1138 <peter1138@openttd.org>2009-01-23 20:53:43 +0000
commit598fdab47ec2dce7896b40d358231e837c34e3b9 (patch)
treee459d4ac788aed994e9b660de8c44224e836c826 /src/train_cmd.cpp
parent42ad9baa720ec80747907b959f8d1b3f333ea8bf (diff)
downloadopenttd-598fdab47ec2dce7896b40d358231e837c34e3b9.tar.xz
(svn r15236) -Codechange: Rename realistic_acceleration patch option to train_acceleration_model, and change from boolean to value. Don't forget to update your settings.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index d79a66dd5..258daabc0 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -1965,7 +1965,7 @@ CommandCost CmdReverseTrainDirection(TileIndex tile, uint32 flags, uint32 p1, ui
if (v->vehstatus & VS_CRASHED || v->breakdown_ctr != 0) return CMD_ERROR;
if (flags & DC_EXEC) {
- if (_settings_game.vehicle.realistic_acceleration && v->cur_speed != 0) {
+ if (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL && v->cur_speed != 0) {
ToggleBit(v->u.rail.flags, VRF_REVERSING);
} else {
v->cur_speed = 0;
@@ -3280,16 +3280,16 @@ static int UpdateTrainSpeed(Vehicle *v)
uint accel;
if (v->vehstatus & VS_STOPPED || HasBit(v->u.rail.flags, VRF_REVERSING) || HasBit(v->u.rail.flags, VRF_TRAIN_STUCK)) {
- if (_settings_game.vehicle.realistic_acceleration) {
- accel = GetTrainAcceleration(v, AM_BRAKE) * 2;
- } else {
- accel = v->acceleration * -2;
+ switch (_settings_game.vehicle.train_acceleration_model) {
+ default: NOT_REACHED();
+ case TAM_ORIGINAL: accel = v->acceleration * -2; break;
+ case TAM_REALISTIC: accel = GetTrainAcceleration(v, AM_BRAKE) * 2; break;
}
} else {
- if (_settings_game.vehicle.realistic_acceleration) {
- accel = GetTrainAcceleration(v, AM_ACCEL);
- } else {
- accel = v->acceleration;
+ switch (_settings_game.vehicle.train_acceleration_model) {
+ default: NOT_REACHED();
+ case TAM_ORIGINAL: accel = v->acceleration; break;
+ case TAM_REALISTIC: accel = GetTrainAcceleration(v, AM_ACCEL); break;
}
}
@@ -3439,7 +3439,7 @@ static const RailtypeSlowdownParams _railtype_slowdown[] = {
/** Modify the speed of the vehicle due to a turn */
static inline void AffectSpeedByDirChange(Vehicle *v, Direction new_dir)
{
- if (_settings_game.vehicle.realistic_acceleration) return;
+ if (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL) return;
DirDiff diff = DirDifference(v->direction, new_dir);
if (diff == DIRDIFF_SAME) return;
@@ -3451,7 +3451,7 @@ static inline void AffectSpeedByDirChange(Vehicle *v, Direction new_dir)
/** Modify the speed of the vehicle due to a change in altitude */
static inline void AffectSpeedByZChange(Vehicle *v, byte old_z)
{
- if (old_z == v->z_pos || _settings_game.vehicle.realistic_acceleration) return;
+ if (old_z == v->z_pos || _settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL) return;
const RailtypeSlowdownParams *rsp = &_railtype_slowdown[v->u.rail.railtype];