(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
This commit is contained in:
bjarni 2006-04-01 14:53:11 +00:00
parent ca2270b3d9
commit 8b1f971c1a
1 changed files with 2 additions and 1 deletions

View File

@ -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);