Changeset - r1221:d3302ddc7c90
[Not reviewed]
master
0 1 0
bjarni - 19 years ago 2005-01-29 23:58:07
bjarni@openttd.org
(svn r1725) - Fix: now trains can only be built in depots and you have to own the depot too (hacked client protection)
1 file changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -524,15 +524,20 @@ int32 CmdBuildRailVehicle(int x, int y, 
 
	Vehicle *v, *u;
 
	byte unit_num;
 
	Engine *e;
 
	uint tile;
 
	uint tile = TILE_FROM_XY(x,y);
 

	
 
	if (!IsEngineBuildable(p1, VEH_Train)) return CMD_ERROR;
 

	
 
	/* NOTE: The AI sends build engine commands without DC_EXEC to figure out if
 
	it can affort an engine before trying to buy it*/
 
	if (!IsTrainDepotTile((TileIndex)tile) && flags & DC_EXEC) return CMD_ERROR;
 

	
 
	if (_map_owner[tile] != _current_player && flags & DC_EXEC) return CMD_ERROR;
 

	
 
	_cmd_build_rail_veh_var1 = 0;
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
 

	
 
	tile = TILE_FROM_XY(x,y);
 
	rvi = RailVehInfo(p1);
 

	
 
	if (rvi->flags & RVI_WAGON) {
0 comments (0 inline, 0 general)