# HG changeset patch # User bjarni # Date 2006-04-01 14:53:11 # Node ID f13f79abbcbdec4745a4af47295bc4942cd19c8d # Parent d671f1730a90381b4cf8c9141e71e836aeb287b7 (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 diff --git a/train_cmd.c b/train_cmd.c --- a/train_cmd.c +++ b/train_cmd.c @@ -723,7 +723,8 @@ int32 CmdBuildRailVehicle(int x, int y, 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);