File diff r12514:dae232b962a6 → r12515:abd5af2c2638
src/station.cpp
Show inline comments
 
@@ -36,13 +36,12 @@ BaseStation::~BaseStation()
 
	free(this->name);
 
	free(this->speclist);
 
}
 

	
 
Station::Station(TileIndex tile) :
 
	SpecializedStation<Station, false>(tile),
 
	train_station(INVALID_TILE, 0, 0),
 
	airport_tile(INVALID_TILE),
 
	dock_tile(INVALID_TILE),
 
	indtype(IT_INVALID),
 
	time_since_load(255),
 
	time_since_unload(255),
 
	last_vehicle_type(VEH_INVALID)
 
@@ -420,13 +419,13 @@ bool StationRect::BeforeAddRect(TileInde
 
		if (IsTileType(tile, MP_STATION) && GetStationIndex(tile) == st_id) return true;
 
	END_TILE_LOOP(tile, width, height, top_left);
 

	
 
	return false;
 
}
 

	
 
bool StationRect::AfterRemoveTile(Station *st, TileIndex tile)
 
bool StationRect::AfterRemoveTile(BaseStation *st, TileIndex tile)
 
{
 
	int x = TileX(tile);
 
	int y = TileY(tile);
 

	
 
	/* look if removed tile was on the bounding rect edge
 
	 * and try to reduce the rect by this edge
 
@@ -470,13 +469,13 @@ bool StationRect::AfterRemoveTile(Statio
 
			return true; // empty remaining rect
 
		}
 
	}
 
	return false; // non-empty remaining rect
 
}
 

	
 
bool StationRect::AfterRemoveRect(Station *st, TileIndex tile, int w, int h)
 
bool StationRect::AfterRemoveRect(BaseStation *st, TileIndex tile, int w, int h)
 
{
 
	assert(PtInExtendedRect(TileX(tile), TileY(tile)));
 
	assert(PtInExtendedRect(TileX(tile) + w - 1, TileY(tile) + h - 1));
 

	
 
	bool empty = this->AfterRemoveTile(st, tile);
 
	if (w != 1 || h != 1) empty = empty || AfterRemoveTile(st, TILE_ADDXY(tile, w - 1, h - 1));