summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-04-01 14:53:11 +0000
committerbjarni <bjarni@openttd.org>2006-04-01 14:53:11 +0000
commit9b44cd5dad9efe2ba8bf0bef2defa2ab2ba2cbcc (patch)
treea5f7c6ef51ff3b104f2b6e4a943c29a1c5bb5922 /train_cmd.c
parent07d94d32b65af7e305bc164b3030c8b201be7509 (diff)
downloadopenttd-9b44cd5dad9efe2ba8bf0bef2defa2ab2ba2cbcc.tar.xz
(svn r4226) -Fix: [elrails] it's no longer possible to build electric engines in non-electric depots
this prevents autoreplace to replace to electric engines before the line in question got catenary
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 6ae53a21d..ca7e095f4 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -723,7 +723,8 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
e = GetEngine(p1);
/* Check if depot and new engine uses the same kind of tracks */
- if (!IsCompatibleRail(e->railtype, GetRailType(tile))) return CMD_ERROR;
+ /* We need to see if the engine got power on the tile to avoid eletric engines in non-electric depots */
+ if (!HasPowerOnRail(e->railtype, GetRailType(tile))) return CMD_ERROR;
if (rvi->flags & RVI_WAGON) return CmdBuildRailWagon(p1, tile, flags);