diff options
author | KUDr <kudr@openttd.org> | 2006-11-17 19:31:44 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-11-17 19:31:44 +0000 |
commit | f2cda44d2e3c55069279ad3e03aeb5d2a7f0f35c (patch) | |
tree | 9c7682092cc873482f869cd11ccca7d20fe73bc2 /train_cmd.c | |
parent | 532271ba65c994ee8bc93752b515b8fc918b6ab5 (diff) | |
download | openttd-f2cda44d2e3c55069279ad3e03aeb5d2a7f0f35c.tar.xz |
(svn r7195) -Feature: [FS#297, optional elrails] New patches/vehicles option 'disable electrified railways'.
(original patch by maedhros, ideas: peter1138, Darkvater, Rubidium, Patrick, Eddi|zuHause, ..)
Diffstat (limited to 'train_cmd.c')
-rw-r--r-- | train_cmd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/train_cmd.c b/train_cmd.c index 6edecc4e6..1179c2958 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -192,6 +192,13 @@ void TrainConsistChanged(Vehicle* v) v->u.rail.compatible_railtypes |= GetRailTypeInfo(u->u.rail.railtype)->powered_railtypes; } + /* Some electric engines can be allowed to run on normal rail. It happens to all + * existing electric engines when elrails are disabled and then re-enabled */ + if (HASBIT(u->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL)) { + u->u.rail.railtype = RAILTYPE_RAIL; + u->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL); + } + // max speed is the minimum of the speed limits of all vehicles in the consist if (!(rvi_u->flags & RVI_WAGON) || _patches.wagon_speed_limits) if (rvi_u->max_speed != 0 && !UsesWagonOverride(u)) |