File diff r27055:8db4d6833ae7 → r27056:ac04ccbeb86c
src/train_cmd.cpp
Show inline comments
 
@@ -626,25 +626,25 @@ static CommandCost CmdBuildRailWagon(DoC
 
		v->gcache.first_engine = INVALID_ENGINE; // needs to be set before first callback
 

	
 
		DiagDirection dir = GetRailDepotDirection(tile);
 

	
 
		v->direction = DiagDirToDir(dir);
 
		v->tile = tile;
 

	
 
		int x = TileX(tile) * TILE_SIZE | _vehicle_initial_x_fract[dir];
 
		int y = TileY(tile) * TILE_SIZE | _vehicle_initial_y_fract[dir];
 

	
 
		v->x_pos = x;
 
		v->y_pos = y;
 
		v->z_pos = GetSlopePixelZ(x, y);
 
		v->z_pos = GetSlopePixelZ(x, y, true);
 
		v->owner = _current_company;
 
		v->track = TRACK_BIT_DEPOT;
 
		v->vehstatus = VS_HIDDEN | VS_DEFPAL;
 

	
 
		v->SetWagon();
 

	
 
		v->SetFreeWagon();
 
		InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 

	
 
		v->cargo_type = e->GetDefaultCargoType();
 
		v->cargo_cap = rvi->capacity;
 
		v->refit_cap = 0;
 
@@ -752,25 +752,25 @@ CommandCost CmdBuildRailVehicle(DoComman
 
	if (flags & DC_EXEC) {
 
		DiagDirection dir = GetRailDepotDirection(tile);
 
		int x = TileX(tile) * TILE_SIZE + _vehicle_initial_x_fract[dir];
 
		int y = TileY(tile) * TILE_SIZE + _vehicle_initial_y_fract[dir];
 

	
 
		Train *v = new Train();
 
		*ret = v;
 
		v->direction = DiagDirToDir(dir);
 
		v->tile = tile;
 
		v->owner = _current_company;
 
		v->x_pos = x;
 
		v->y_pos = y;
 
		v->z_pos = GetSlopePixelZ(x, y);
 
		v->z_pos = GetSlopePixelZ(x, y, true);
 
		v->track = TRACK_BIT_DEPOT;
 
		v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL;
 
		v->spritenum = rvi->image_index;
 
		v->cargo_type = e->GetDefaultCargoType();
 
		v->cargo_cap = rvi->capacity;
 
		v->refit_cap = 0;
 
		v->last_station_visited = INVALID_STATION;
 
		v->last_loading_station = INVALID_STATION;
 

	
 
		v->engine_type = e->index;
 
		v->gcache.first_engine = INVALID_ENGINE; // needs to be set before first callback