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 | ff7e46f37829e8bbc53a5cad6fdb4b507c531577 (patch) | |
tree | 9c7682092cc873482f869cd11ccca7d20fe73bc2 /train_cmd.c | |
parent | fd8dd81b74a065dc201f6a2fc2cde4373340e570 (diff) | |
download | openttd-ff7e46f37829e8bbc53a5cad6fdb4b507c531577.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)) |