Changeset - r12234:fd1a494e7620
[Not reviewed]
master
0 14 0
smatz - 15 years ago 2009-06-25 19:23:09
smatz@openttd.org
(svn r16659) -Codechange: rename GetAcceptedCargo() to AddAcceptedCargo() and change its behaviour accordingly
-Codechange: remove dummy GetAcceptedCargo_*() handlers
14 files changed with 36 insertions and 82 deletions:
0 comments (0 inline, 0 general)
src/clear_cmd.cpp
Show inline comments
 
@@ -115,17 +115,12 @@ static uint GetSlopeZ_Clear(TileIndex ti
 

	
 
static Foundation GetFoundation_Clear(TileIndex tile, Slope tileh)
 
{
 
	return FOUNDATION_NONE;
 
}
 

	
 
static void GetAcceptedCargo_Clear(TileIndex tile, AcceptedCargo ac)
 
{
 
	/* unused */
 
}
 

	
 
static void AnimateTile_Clear(TileIndex tile)
 
{
 
	/* unused */
 
}
 

	
 
void TileLoopClearHelper(TileIndex tile)
 
@@ -360,13 +355,13 @@ static CommandCost TerraformTile_Clear(T
 
}
 

	
 
extern const TileTypeProcs _tile_type_clear_procs = {
 
	DrawTile_Clear,           ///< draw_tile_proc
 
	GetSlopeZ_Clear,          ///< get_slope_z_proc
 
	ClearTile_Clear,          ///< clear_tile_proc
 
	GetAcceptedCargo_Clear,   ///< get_accepted_cargo_proc
 
	NULL,                     ///< get_accepted_cargo_proc
 
	GetTileDesc_Clear,        ///< get_tile_desc_proc
 
	GetTileTrackStatus_Clear, ///< get_tile_track_status_proc
 
	ClickTile_Clear,          ///< click_tile_proc
 
	AnimateTile_Clear,        ///< animate_tile_proc
 
	TileLoop_Clear,           ///< tile_loop_clear
 
	ChangeTileOwner_Clear,    ///< change_tile_owner_clear
src/dummy_land.cpp
Show inline comments
 
@@ -30,17 +30,12 @@ static Foundation GetFoundation_Dummy(Ti
 
static CommandCost ClearTile_Dummy(TileIndex tile, DoCommandFlag flags)
 
{
 
	return_cmd_error(STR_ERROR_OFF_EDGE_OF_MAP);
 
}
 

	
 

	
 
static void GetAcceptedCargo_Dummy(TileIndex tile, AcceptedCargo ac)
 
{
 
	/* not used */
 
}
 

	
 
static void GetTileDesc_Dummy(TileIndex tile, TileDesc *td)
 
{
 
	td->str = STR_EMPTY;
 
	td->owner[0] = OWNER_NONE;
 
}
 

	
 
@@ -76,13 +71,13 @@ static CommandCost TerraformTile_Dummy(T
 
}
 

	
 
extern const TileTypeProcs _tile_type_dummy_procs = {
 
	DrawTile_Dummy,           // draw_tile_proc
 
	GetSlopeZ_Dummy,          // get_slope_z_proc
 
	ClearTile_Dummy,          // clear_tile_proc
 
	GetAcceptedCargo_Dummy,   // get_accepted_cargo_proc
 
	NULL,                     // get_accepted_cargo_proc
 
	GetTileDesc_Dummy,        // get_tile_desc_proc
 
	GetTileTrackStatus_Dummy, // get_tile_track_status_proc
 
	ClickTile_Dummy,          // click_tile_proc
 
	AnimateTile_Dummy,        // animate_tile_proc
 
	TileLoop_Dummy,           // tile_loop_clear
 
	ChangeTileOwner_Dummy,    // change_tile_owner_clear
src/industry_cmd.cpp
Show inline comments
 
@@ -351,13 +351,13 @@ static Foundation GetFoundation_Industry
 
			if (callback_res == 0) return FOUNDATION_NONE;
 
		}
 
	}
 
	return FlatteningFoundation(tileh);
 
}
 

	
 
static void GetAcceptedCargo_Industry(TileIndex tile, AcceptedCargo ac)
 
static void AddAcceptedCargo_Industry(TileIndex tile, AcceptedCargo ac)
 
{
 
	IndustryGfx gfx = GetIndustryGfx(tile);
 
	const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx);
 

	
 
	/* When we have to use a callback, we put our data in the next two variables */
 
	CargoID raw_accepts_cargo[lengthof(itspec->accepts_cargo)];
 
@@ -382,14 +382,13 @@ static void GetAcceptedCargo_Industry(Ti
 
			for (uint i = 0; i < lengthof(itspec->accepts_cargo); i++) raw_acceptance[i] = GB(res, i * 4, 4);
 
		}
 
	}
 

	
 
	for (byte i = 0; i < lengthof(itspec->accepts_cargo); i++) {
 
		CargoID a = accepts_cargo[i];
 
		/* Only set the value once. */
 
		if (a != CT_INVALID && ac[a] == 0) ac[a] = acceptance[i];
 
		if (a != CT_INVALID) ac[a] += acceptance[i];
 
	}
 
}
 

	
 
static void GetTileDesc_Industry(TileIndex tile, TileDesc *td)
 
{
 
	const Industry *i = GetIndustryByTile(tile);
 
@@ -2382,13 +2381,13 @@ static CommandCost TerraformTile_Industr
 
}
 

	
 
extern const TileTypeProcs _tile_type_industry_procs = {
 
	DrawTile_Industry,           // draw_tile_proc
 
	GetSlopeZ_Industry,          // get_slope_z_proc
 
	ClearTile_Industry,          // clear_tile_proc
 
	GetAcceptedCargo_Industry,   // get_accepted_cargo_proc
 
	AddAcceptedCargo_Industry,   // add_accepted_cargo_proc
 
	GetTileDesc_Industry,        // get_tile_desc_proc
 
	GetTileTrackStatus_Industry, // get_tile_track_status_proc
 
	ClickTile_Industry,          // click_tile_proc
 
	AnimateTile_Industry,        // animate_tile_proc
 
	TileLoop_Industry,           // tile_loop_proc
 
	ChangeTileOwner_Industry,    // change_tile_owner_proc
src/landscape.cpp
Show inline comments
 
@@ -497,18 +497,12 @@ TrackStatus GetTileTrackStatus(TileIndex
 
 */
 
void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner)
 
{
 
	_tile_type_procs[GetTileType(tile)]->change_tile_owner_proc(tile, old_owner, new_owner);
 
}
 

	
 
void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac)
 
{
 
	memset(ac, 0, sizeof(AcceptedCargo));
 
	_tile_type_procs[GetTileType(tile)]->get_accepted_cargo_proc(tile, ac);
 
}
 

	
 
void AnimateTile(TileIndex tile)
 
{
 
	_tile_type_procs[GetTileType(tile)]->animate_tile_proc(tile);
 
}
 

	
 
bool ClickTile(TileIndex tile)
src/misc_gui.cpp
Show inline comments
 
@@ -105,13 +105,12 @@ public:
 

	
 
	LandInfoWindow(TileIndex tile) : Window(&_land_info_desc) {
 
		Town *t = ClosestTownFromTile(tile, _settings_game.economy.dist_local_authority);
 

	
 
		/* Because build_date is not set yet in every TileDesc, we make sure it is empty */
 
		TileDesc td;
 
		AcceptedCargo ac;
 

	
 
		td.build_date = INVALID_DATE;
 

	
 
		/* Most tiles have only one owner, but
 
		 *  - drivethrough roadstops can be build on town owned roads (up to 2 owners) and
 
		 *  - roads can have up to four owners (railroad, road, tram, 3rd-roadtype "highway").
 
@@ -127,13 +126,15 @@ public:
 

	
 
		td.station_class = STR_NULL;
 
		td.station_name = STR_NULL;
 

	
 
		td.grf = NULL;
 

	
 
		GetAcceptedCargo(tile, ac);
 
		AcceptedCargo ac;
 
		memset(ac, 0, sizeof(AcceptedCargo));
 
		AddAcceptedCargo(tile, ac);
 
		GetTileDesc(tile, &td);
 

	
 
		uint line_nr = 0;
 

	
 
		/* Tiletype */
 
		SetDParam(0, td.dparam[0]);
src/rail_cmd.cpp
Show inline comments
 
@@ -2071,17 +2071,12 @@ static uint GetSlopeZ_Track(TileIndex ti
 

	
 
static Foundation GetFoundation_Track(TileIndex tile, Slope tileh)
 
{
 
	return IsPlainRail(tile) ? GetRailFoundation(tileh, GetTrackBits(tile)) : FlatteningFoundation(tileh);
 
}
 

	
 
static void GetAcceptedCargo_Track(TileIndex tile, AcceptedCargo ac)
 
{
 
	/* not used */
 
}
 

	
 
static void AnimateTile_Track(TileIndex tile)
 
{
 
	/* not used */
 
}
 

	
 
static void TileLoop_Track(TileIndex tile)
 
@@ -2617,13 +2612,13 @@ static CommandCost TerraformTile_Track(T
 

	
 

	
 
extern const TileTypeProcs _tile_type_rail_procs = {
 
	DrawTile_Track,           // draw_tile_proc
 
	GetSlopeZ_Track,          // get_slope_z_proc
 
	ClearTile_Track,          // clear_tile_proc
 
	GetAcceptedCargo_Track,   // get_accepted_cargo_proc
 
	NULL,                     // get_accepted_cargo_proc
 
	GetTileDesc_Track,        // get_tile_desc_proc
 
	GetTileTrackStatus_Track, // get_tile_track_status_proc
 
	ClickTile_Track,          // click_tile_proc
 
	AnimateTile_Track,        // animate_tile_proc
 
	TileLoop_Track,           // tile_loop_clear
 
	ChangeTileOwner_Track,    // change_tile_owner_clear
src/road_cmd.cpp
Show inline comments
 
@@ -1284,17 +1284,12 @@ static Foundation GetFoundation_Road(Til
 
		return GetRoadFoundation(tileh, GetAllRoadBits(tile));
 
	} else {
 
		return FlatteningFoundation(tileh);
 
	}
 
}
 

	
 
static void GetAcceptedCargo_Road(TileIndex tile, AcceptedCargo ac)
 
{
 
	/* not used */
 
}
 

	
 
static void AnimateTile_Road(TileIndex tile)
 
{
 
	if (IsLevelCrossing(tile)) MarkTileDirtyByTile(tile);
 
}
 

	
 

	
 
@@ -1634,13 +1629,13 @@ static CommandCost TerraformTile_Road(Ti
 

	
 
/** Tile callback functions for road tiles */
 
extern const TileTypeProcs _tile_type_road_procs = {
 
	DrawTile_Road,           // draw_tile_proc
 
	GetSlopeZ_Road,          // get_slope_z_proc
 
	ClearTile_Road,          // clear_tile_proc
 
	GetAcceptedCargo_Road,   // get_accepted_cargo_proc
 
	NULL,                    // get_accepted_cargo_proc
 
	GetTileDesc_Road,        // get_tile_desc_proc
 
	GetTileTrackStatus_Road, // get_tile_track_status_proc
 
	ClickTile_Road,          // click_tile_proc
 
	AnimateTile_Road,        // animate_tile_proc
 
	TileLoop_Road,           // tile_loop_clear
 
	ChangeTileOwner_Road,    // change_tile_owner_clear
src/station_cmd.cpp
Show inline comments
 
@@ -521,19 +521,13 @@ void GetAcceptanceAroundTiles(AcceptedCa
 
	assert(w > 0);
 
	assert(h > 0);
 

	
 
	for (int yc = y1; yc != y2; yc++) {
 
		for (int xc = x1; xc != x2; xc++) {
 
			TileIndex tile = TileXY(xc, yc);
 

	
 
			if (!IsTileType(tile, MP_STATION)) {
 
				AcceptedCargo ac;
 

	
 
				GetAcceptedCargo(tile, ac);
 
				for (uint i = 0; i < lengthof(ac); ++i) accepts[i] += ac[i];
 
			}
 
			AddAcceptedCargo(tile, accepts);
 
		}
 
	}
 
}
 

	
 
/** Update the acceptance for a station.
 
 * @param st Station to update
 
@@ -2345,17 +2339,12 @@ static uint GetSlopeZ_Station(TileIndex 
 

	
 
static Foundation GetFoundation_Station(TileIndex tile, Slope tileh)
 
{
 
	return FlatteningFoundation(tileh);
 
}
 

	
 
static void GetAcceptedCargo_Station(TileIndex tile, AcceptedCargo ac)
 
{
 
	/* not used */
 
}
 

	
 
static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
 
{
 
	td->owner[0] = GetTileOwner(tile);
 
	if (IsDriveThroughStopTile(tile)) {
 
		Owner road_owner = INVALID_OWNER;
 
		Owner tram_owner = INVALID_OWNER;
 
@@ -3160,13 +3149,13 @@ static CommandCost TerraformTile_Station
 

	
 

	
 
extern const TileTypeProcs _tile_type_station_procs = {
 
	DrawTile_Station,           // draw_tile_proc
 
	GetSlopeZ_Station,          // get_slope_z_proc
 
	ClearTile_Station,          // clear_tile_proc
 
	GetAcceptedCargo_Station,   // get_accepted_cargo_proc
 
	NULL,                       // get_accepted_cargo_proc
 
	GetTileDesc_Station,        // get_tile_desc_proc
 
	GetTileTrackStatus_Station, // get_tile_track_status_proc
 
	ClickTile_Station,          // click_tile_proc
 
	AnimateTile_Station,        // animate_tile_proc
 
	TileLoop_Station,           // tile_loop_clear
 
	ChangeTileOwner_Station,    // change_tile_owner_clear
src/tile_cmd.h
Show inline comments
 
@@ -13,12 +13,13 @@
 
#include "strings_type.h"
 
#include "date_type.h"
 
#include "company_type.h"
 
#include "direction_type.h"
 
#include "track_type.h"
 
#include "transport_type.h"
 
#include "tile_map.h"
 

	
 
/** The returned bits of VehicleEnterTile. */
 
enum VehicleEnterTileStatus {
 
	VETS_ENTERED_STATION  = 1, ///< The vehicle entered a station
 
	VETS_ENTERED_WORMHOLE = 2, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
 
	VETS_CANNOT_ENTER     = 3, ///< The vehicle cannot enter the tile
 
@@ -70,13 +71,13 @@ typedef CommandCost ClearTileProc(TileIn
 

	
 
/**
 
 * Tile callback function signature for obtaining accepted cargo of a tile
 
 * @param tile Tile queried for its accepted cargo
 
 * @param res  Storage destination of the cargo accepted
 
 */
 
typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res);
 
typedef void AddAcceptedCargoProc(TileIndex tile, AcceptedCargo res);
 

	
 
/**
 
 * Tile callback function signature for obtaining a tile description
 
 * @param tile Tile being queried
 
 * @param td   Storage pointer for returned tile description
 
 */
 
@@ -133,13 +134,13 @@ typedef CommandCost TerraformTileProc(Ti
 
 * Set of callback functions for performing tile operations of a given tile type.
 
 * @see TileType */
 
struct TileTypeProcs {
 
	DrawTileProc *draw_tile_proc;                  ///< Called to render the tile and its contents to the screen
 
	GetSlopeZProc *get_slope_z_proc;
 
	ClearTileProc *clear_tile_proc;
 
	GetAcceptedCargoProc *get_accepted_cargo_proc; ///< Return accepted cargo of the tile
 
	AddAcceptedCargoProc *add_accepted_cargo_proc; ///< Adds accepted cargo of the tile to cargo array supplied as parameter
 
	GetTileDescProc *get_tile_desc_proc;           ///< Get a description of a tile (for the 'land area information' tool)
 
	GetTileTrackStatusProc *get_tile_track_status_proc; ///< Get available tracks and status of a tile
 
	ClickTileProc *click_tile_proc;                ///< Called when tile is clicked
 
	AnimateTileProc *animate_tile_proc;
 
	TileLoopProc *tile_loop_proc;
 
	ChangeTileOwnerProc *change_tile_owner_proc;
 
@@ -150,13 +151,19 @@ struct TileTypeProcs {
 
};
 

	
 
extern const TileTypeProcs * const _tile_type_procs[16];
 

	
 
TrackStatus GetTileTrackStatus(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side = INVALID_DIAGDIR);
 
VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y);
 
void GetAcceptedCargo(TileIndex tile, AcceptedCargo ac);
 
void ChangeTileOwner(TileIndex tile, Owner old_owner, Owner new_owner);
 
void AnimateTile(TileIndex tile);
 
bool ClickTile(TileIndex tile);
 
void GetTileDesc(TileIndex tile, TileDesc *td);
 

	
 
static inline void AddAcceptedCargo(TileIndex tile, AcceptedCargo ac)
 
{
 
	AddAcceptedCargoProc *proc = _tile_type_procs[GetTileType(tile)]->add_accepted_cargo_proc;
 
	if (proc == NULL) return;
 
	proc(tile, ac);
 
}
 

	
 
#endif /* TILE_CMD_H */
src/town_cmd.cpp
Show inline comments
 
@@ -566,13 +566,13 @@ static void GetProducedCargo_Town(TileIn
 
		if (hs->mail_generation > 0) {
 
			*(b++) = CT_MAIL;
 
		}
 
	}
 
}
 

	
 
static void GetAcceptedCargo_Town(TileIndex tile, AcceptedCargo ac)
 
static void AddAcceptedCargo_Town(TileIndex tile, AcceptedCargo ac)
 
{
 
	const HouseSpec *hs = GetHouseSpecs(GetHouseType(tile));
 
	CargoID accepts[3];
 

	
 
	/* Set the initial accepted cargo types */
 
	for (uint8 i = 0; i < lengthof(accepts); i++) {
 
@@ -591,27 +591,27 @@ static void GetAcceptedCargo_Town(TileIn
 
	}
 

	
 
	/* Check for custom cargo acceptance */
 
	if (HasBit(hs->callback_mask, CBM_HOUSE_CARGO_ACCEPTANCE)) {
 
		uint16 callback = GetHouseCallback(CBID_HOUSE_CARGO_ACCEPTANCE, 0, 0, GetHouseType(tile), GetTownByTile(tile), tile);
 
		if (callback != CALLBACK_FAILED) {
 
			if (accepts[0] != CT_INVALID) ac[accepts[0]] = GB(callback, 0, 4);
 
			if (accepts[1] != CT_INVALID) ac[accepts[1]] = GB(callback, 4, 4);
 
			if (accepts[0] != CT_INVALID) ac[accepts[0]] += GB(callback, 0, 4);
 
			if (accepts[1] != CT_INVALID) ac[accepts[1]] += GB(callback, 4, 4);
 
			if (_settings_game.game_creation.landscape != LT_TEMPERATE && HasBit(callback, 12)) {
 
				/* The 'S' bit indicates food instead of goods */
 
				ac[CT_FOOD] = GB(callback, 8, 4);
 
				ac[CT_FOOD] += GB(callback, 8, 4);
 
			} else {
 
				if (accepts[2] != CT_INVALID) ac[accepts[2]] = GB(callback, 8, 4);
 
				if (accepts[2] != CT_INVALID) ac[accepts[2]] += GB(callback, 8, 4);
 
			}
 
			return;
 
		}
 
	}
 

	
 
	/* No custom acceptance, so fill in with the default values */
 
	for (uint8 i = 0; i < lengthof(accepts); i++) {
 
		if (accepts[i] != CT_INVALID) ac[accepts[i]] = hs->cargo_acceptance[i];
 
		if (accepts[i] != CT_INVALID) ac[accepts[i]] += hs->cargo_acceptance[i];
 
	}
 
}
 

	
 
static void GetTileDesc_Town(TileIndex tile, TileDesc *td)
 
{
 
	const HouseID house = GetHouseType(tile);
 
@@ -2880,13 +2880,13 @@ static CommandCost TerraformTile_Town(Ti
 

	
 
/** Tile callback functions for a town */
 
extern const TileTypeProcs _tile_type_town_procs = {
 
	DrawTile_Town,           // draw_tile_proc
 
	GetSlopeZ_Town,          // get_slope_z_proc
 
	ClearTile_Town,          // clear_tile_proc
 
	GetAcceptedCargo_Town,   // get_accepted_cargo_proc
 
	AddAcceptedCargo_Town,   // add_accepted_cargo_proc
 
	GetTileDesc_Town,        // get_tile_desc_proc
 
	GetTileTrackStatus_Town, // get_tile_track_status_proc
 
	ClickTile_Town,          // click_tile_proc
 
	AnimateTile_Town,        // animate_tile_proc
 
	TileLoop_Town,           // tile_loop_clear
 
	ChangeTileOwner_Town,    // change_tile_owner_clear
src/tree_cmd.cpp
Show inline comments
 
@@ -541,17 +541,12 @@ static CommandCost ClearTile_Trees(TileI
 

	
 
	if (flags & DC_EXEC) DoClearSquare(tile);
 

	
 
	return CommandCost(EXPENSES_CONSTRUCTION, num * _price.remove_trees);
 
}
 

	
 
static void GetAcceptedCargo_Trees(TileIndex tile, AcceptedCargo ac)
 
{
 
	/* not used */
 
}
 

	
 
static void GetTileDesc_Trees(TileIndex tile, TileDesc *td)
 
{
 
	TreeType tt = GetTreeType(tile);
 

	
 
	if (IsInsideMM(tt, TREE_RAINFOREST, TREE_CACTUS)) {
 
		td->str = STR_TREE_NAME_RAINFOREST;
 
@@ -770,13 +765,13 @@ static CommandCost TerraformTile_Trees(T
 

	
 

	
 
extern const TileTypeProcs _tile_type_trees_procs = {
 
	DrawTile_Trees,           // draw_tile_proc
 
	GetSlopeZ_Trees,          // get_slope_z_proc
 
	ClearTile_Trees,          // clear_tile_proc
 
	GetAcceptedCargo_Trees,   // get_accepted_cargo_proc
 
	NULL,                     // get_accepted_cargo_proc
 
	GetTileDesc_Trees,        // get_tile_desc_proc
 
	GetTileTrackStatus_Trees, // get_tile_track_status_proc
 
	ClickTile_Trees,          // click_tile_proc
 
	AnimateTile_Trees,        // animate_tile_proc
 
	TileLoop_Trees,           // tile_loop_clear
 
	ChangeTileOwner_Trees,    // change_tile_owner_clear
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -1244,18 +1244,12 @@ static uint GetSlopeZ_TunnelBridge(TileI
 

	
 
static Foundation GetFoundation_TunnelBridge(TileIndex tile, Slope tileh)
 
{
 
	return IsTunnel(tile) ? FOUNDATION_NONE : GetBridgeFoundation(tileh, DiagDirToAxis(GetTunnelBridgeDirection(tile)));
 
}
 

	
 

	
 
static void GetAcceptedCargo_TunnelBridge(TileIndex tile, AcceptedCargo ac)
 
{
 
	/* not used */
 
}
 

	
 
static void GetTileDesc_TunnelBridge(TileIndex tile, TileDesc *td)
 
{
 
	TransportType tt = GetTunnelBridgeTransportType(tile);
 

	
 
	if (IsTunnel(tile)) {
 
		td->str = (tt == TRANSPORT_RAIL) ? STR_TUNNEL_DESCRIPTION_RAILROAD : STR_TUNNEL_DESCRIPTION_ROAD;
 
@@ -1543,13 +1537,13 @@ static CommandCost TerraformTile_TunnelB
 
}
 

	
 
extern const TileTypeProcs _tile_type_tunnelbridge_procs = {
 
	DrawTile_TunnelBridge,           // draw_tile_proc
 
	GetSlopeZ_TunnelBridge,          // get_slope_z_proc
 
	ClearTile_TunnelBridge,          // clear_tile_proc
 
	GetAcceptedCargo_TunnelBridge,   // get_accepted_cargo_proc
 
	NULL,                            // get_accepted_cargo_proc
 
	GetTileDesc_TunnelBridge,        // get_tile_desc_proc
 
	GetTileTrackStatus_TunnelBridge, // get_tile_track_status_proc
 
	ClickTile_TunnelBridge,          // click_tile_proc
 
	AnimateTile_TunnelBridge,        // animate_tile_proc
 
	TileLoop_TunnelBridge,           // tile_loop_clear
 
	ChangeTileOwner_TunnelBridge,    // change_tile_owner_clear
src/unmovable_cmd.cpp
Show inline comments
 
@@ -288,31 +288,31 @@ static CommandCost ClearTile_Unmovable(T
 
		DoClearSquare(tile);
 
	}
 

	
 
	return CommandCost();
 
}
 

	
 
static void GetAcceptedCargo_Unmovable(TileIndex tile, AcceptedCargo ac)
 
static void AddAcceptedCargo_Unmovable(TileIndex tile, AcceptedCargo ac)
 
{
 
	if (!IsCompanyHQ(tile)) return;
 

	
 
	/* HQ accepts passenger and mail; but we have to divide the values
 
	 * between 4 tiles it occupies! */
 

	
 
	/* HQ level (depends on company performance) in the range 1..5. */
 
	uint level = GetCompanyHQSize(tile) + 1;
 

	
 
	/* Top town building generates 10, so to make HQ interesting, the top
 
	 * type makes 20. */
 
	ac[CT_PASSENGERS] = max(1U, level);
 
	ac[CT_PASSENGERS] += max(1U, level);
 

	
 
	/* Top town building generates 4, HQ can make up to 8. The
 
	 * proportion passengers:mail is different because such a huge
 
	 * commercial building generates unusually high amount of mail
 
	 * correspondence per physical visitor. */
 
	ac[CT_MAIL] = max(1U, level / 2);
 
	ac[CT_MAIL] += max(1U, level / 2);
 
}
 

	
 

	
 
static void GetTileDesc_Unmovable(TileIndex tile, TileDesc *td)
 
{
 
	td->str = GetUnmovableSpec(GetUnmovableType(tile))->name;
 
@@ -498,13 +498,13 @@ static CommandCost TerraformTile_Unmovab
 
}
 

	
 
extern const TileTypeProcs _tile_type_unmovable_procs = {
 
	DrawTile_Unmovable,             // draw_tile_proc
 
	GetSlopeZ_Unmovable,            // get_slope_z_proc
 
	ClearTile_Unmovable,            // clear_tile_proc
 
	GetAcceptedCargo_Unmovable,     // get_accepted_cargo_proc
 
	AddAcceptedCargo_Unmovable,     // add_accepted_cargo_proc
 
	GetTileDesc_Unmovable,          // get_tile_desc_proc
 
	GetTileTrackStatus_Unmovable,   // get_tile_track_status_proc
 
	ClickTile_Unmovable,            // click_tile_proc
 
	AnimateTile_Unmovable,          // animate_tile_proc
 
	TileLoop_Unmovable,             // tile_loop_clear
 
	ChangeTileOwner_Unmovable,      // change_tile_owner_clear
src/water_cmd.cpp
Show inline comments
 
@@ -679,17 +679,12 @@ static uint GetSlopeZ_Water(TileIndex ti
 

	
 
static Foundation GetFoundation_Water(TileIndex tile, Slope tileh)
 
{
 
	return FOUNDATION_NONE;
 
}
 

	
 
static void GetAcceptedCargo_Water(TileIndex tile, AcceptedCargo ac)
 
{
 
	/* not used */
 
}
 

	
 
static void GetTileDesc_Water(TileIndex tile, TileDesc *td)
 
{
 
	switch (GetWaterTileType(tile)) {
 
		case WATER_TILE_CLEAR:
 
			switch (GetWaterClass(tile)) {
 
				case WATER_CLASS_SEA:   td->str = STR_WATER_DESCRIPTION_WATER;     break;
 
@@ -1157,13 +1152,13 @@ static CommandCost TerraformTile_Water(T
 

	
 

	
 
extern const TileTypeProcs _tile_type_water_procs = {
 
	DrawTile_Water,           // draw_tile_proc
 
	GetSlopeZ_Water,          // get_slope_z_proc
 
	ClearTile_Water,          // clear_tile_proc
 
	GetAcceptedCargo_Water,   // get_accepted_cargo_proc
 
	NULL,                     // get_accepted_cargo_proc
 
	GetTileDesc_Water,        // get_tile_desc_proc
 
	GetTileTrackStatus_Water, // get_tile_track_status_proc
 
	ClickTile_Water,          // click_tile_proc
 
	AnimateTile_Water,        // animate_tile_proc
 
	TileLoop_Water,           // tile_loop_clear
 
	ChangeTileOwner_Water,    // change_tile_owner_clear
0 comments (0 inline, 0 general)