mirror of https://github.com/OpenTTD/OpenTTD
(svn r1588) -Fix: [ 1105959 ] coded a workaround in the acceleration code so that
trains don't think they're on a slope while they drive around in a tunnelrelease/0.4.5
parent
7c28bafba9
commit
f40ff3c134
10
train_cmd.c
10
train_cmd.c
|
@ -100,10 +100,12 @@ static int GetRealisticAcceleration(Vehicle *v)
|
||||||
uint mass = rvi->weight + ((_cargoc.weights[u->cargo_type] * u->cargo_count) >> 4);
|
uint mass = rvi->weight + ((_cargoc.weights[u->cargo_type] * u->cargo_count) >> 4);
|
||||||
if (rvi->power) emass += mass;
|
if (rvi->power) emass += mass;
|
||||||
|
|
||||||
if (HASBIT(u->u.rail.flags, VRF_GOINGUP)) {
|
if (!IsTileType(u->tile, MP_TUNNELBRIDGE)) {
|
||||||
f += (float)mass * ( -F_GRAV * F_THETA);
|
if (HASBIT(u->u.rail.flags, VRF_GOINGUP)) {
|
||||||
} else if (HASBIT(u->u.rail.flags, VRF_GOINGDOWN)) {
|
f += (float)mass * ( -F_GRAV * F_THETA);
|
||||||
f += (float)mass * ( F_GRAV * F_THETA);
|
} else if (HASBIT(u->u.rail.flags, VRF_GOINGDOWN)) {
|
||||||
|
f += (float)mass * ( F_GRAV * F_THETA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute curve penalty..
|
// compute curve penalty..
|
||||||
|
|
Loading…
Reference in New Issue