Changeset - r3411:f13f79abbcbd
[Not reviewed]
master
0 1 0
bjarni - 19 years ago 2006-04-01 14:53:11
bjarni@openttd.org
(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
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -720,13 +720,14 @@ int32 CmdBuildRailVehicle(int x, int y, 
 
	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 

	
 
	rvi = RailVehInfo(p1);
 
	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);
 

	
 
	value = EstimateTrainCost(rvi);
 

	
 
	num_vehicles = (rvi->flags & RVI_MULTIHEAD) ? 2 : 1;
0 comments (0 inline, 0 general)