Changeset - r3884:d1a761c29795
[Not reviewed]
master
0 11 0
tron - 19 years ago 2006-05-21 13:51:36
tron@openttd.org
(svn r4940) Remove the dubious feature of remembering the last built depot. It serves no real purpose except causing confusion
11 files changed with 13 insertions and 102 deletions:
0 comments (0 inline, 0 general)
aircraft_gui.c
Show inline comments
 
@@ -1082,25 +1082,10 @@ static void PlayerAircraftWndProc(Window
 
			}
 
		} break;
 

	
 
		case 9: { /* Build new Vehicle */
 
			TileIndex tile;
 

	
 
			if (!IsWindowOfPrototype(w, _player_aircraft_widgets))
 
				break;
 

	
 
			tile = _last_built_aircraft_depot_tile;
 
			do {
 
				if (IsHangarTile(tile) && IsTileOwner(tile, _local_player)) {
 
					ShowAircraftDepotWindow(tile);
 
					ShowBuildAircraftWindow(tile);
 
					return;
 
				}
 

	
 
				tile = TILE_MASK(tile + 1);
 
			} while (tile != _last_built_aircraft_depot_tile);
 

	
 
		case 9: /* Build new Vehicle */
 
			if (!IsWindowOfPrototype(w, _player_aircraft_widgets)) break;
 
			ShowBuildAircraftWindow(0);
 
		} break;
 
			break;
 

	
 
		case 10:
 
			if (!IsWindowOfPrototype(w, _player_aircraft_widgets))
airport_gui.c
Show inline comments
 
@@ -249,5 +249,4 @@ static void ShowBuildAirportPicker(void)
 
void InitializeAirportGui(void)
 
{
 
	_selected_airport_type = AT_SMALL;
 
	_last_built_aircraft_depot_tile = 0;
 
}
depot.h
Show inline comments
 
@@ -60,10 +60,6 @@ static inline uint16 GetServiceIntervalC
 
	return (_patches.servint_ispercent) ? clamp(index, MIN_SERVINT_PERCENT, MAX_SERVINT_PERCENT) : clamp(index, MIN_SERVINT_DAYS, MAX_SERVINT_DAYS);
 
}
 

	
 
VARDEF TileIndex _last_built_train_depot_tile;
 
VARDEF TileIndex _last_built_road_depot_tile;
 
VARDEF TileIndex _last_built_aircraft_depot_tile;
 
VARDEF TileIndex _last_built_ship_depot_tile;
 

	
 
/**
 
 * Check if a depot really exists.
misc.c
Show inline comments
 
@@ -96,12 +96,9 @@ void InitializeDepot(void);
 
void InitializeEngines(void);
 
void InitializeOrders(void);
 
void InitializeClearLand(void);
 
void InitializeRail(void);
 
void InitializeRailGui(void);
 
void InitializeRoad(void);
 
void InitializeRoadGui(void);
 
void InitializeAirportGui(void);
 
void InitializeDock(void);
 
void InitializeDockGui(void);
 
void InitializeIndustries(void);
 
void InitializeMainGui(void);
 
@@ -157,12 +154,9 @@ void InitializeGame(int mode, uint size_
 
	InitNewsItemStructs();
 
	InitializeLandscape();
 
	InitializeClearLand();
 
	InitializeRail();
 
	InitializeRailGui();
 
	InitializeRoad();
 
	InitializeRoadGui();
 
	InitializeAirportGui();
 
	InitializeDock();
 
	InitializeDockGui();
 
	InitializeTowns();
 
	InitializeTrees();
rail_cmd.c
Show inline comments
 
@@ -590,8 +590,6 @@ int32 CmdBuildTrainDepot(TileIndex tile,
 
	if (d == NULL) return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		if (IsLocalPlayer()) _last_built_train_depot_tile = tile;
 

	
 
		MakeRailDepot(tile, _current_player, p2, p1);
 
		MarkTileDirtyByTile(tile);
 

	
 
@@ -2032,10 +2030,6 @@ static uint32 VehicleEnter_Track(Vehicle
 
	return 0;
 
}
 

	
 
void InitializeRail(void)
 
{
 
	_last_built_train_depot_tile = 0;
 
}
 

	
 
const TileTypeProcs _tile_type_rail_procs = {
 
	DrawTile_Track,						/* draw_tile_proc */
road_cmd.c
Show inline comments
 
@@ -577,8 +577,6 @@ int32 CmdBuildRoadDepot(TileIndex tile, 
 
	if (dep == NULL) return CMD_ERROR;
 

	
 
	if (flags & DC_EXEC) {
 
		if (IsLocalPlayer()) _last_built_road_depot_tile = tile;
 

	
 
		dep->xy = tile;
 
		dep->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
 

	
 
@@ -1081,10 +1079,6 @@ static void ChangeTileOwner_Road(TileInd
 
	}
 
}
 

	
 
void InitializeRoad(void)
 
{
 
	_last_built_road_depot_tile = 0;
 
}
 

	
 
const TileTypeProcs _tile_type_road_procs = {
 
	DrawTile_Road,						/* draw_tile_proc */
roadveh_gui.c
Show inline comments
 
@@ -968,25 +968,11 @@ static void PlayerRoadVehWndProc(Window 
 
			}
 
		} break;
 

	
 
		case 9: { /* Build new Vehicle */
 
			TileIndex tile;
 

	
 
			if (!IsWindowOfPrototype(w, _player_roadveh_widgets))
 
				break;
 
		case 9: /* Build new Vehicle */
 
			if (!IsWindowOfPrototype(w, _player_roadveh_widgets)) break;
 
			ShowBuildRoadVehWindow(0);
 
			break;
 

	
 
			tile = _last_built_road_depot_tile;
 
			do {
 
				if (IsTileDepotType(tile, TRANSPORT_ROAD) && IsTileOwner(tile, _local_player)) {
 
					ShowRoadDepotWindow(tile);
 
					ShowBuildRoadVehWindow(tile);
 
					return;
 
				}
 

	
 
				tile = TILE_MASK(tile + 1);
 
			} while (tile != _last_built_road_depot_tile);
 

	
 
			ShowBuildRoadVehWindow(0);
 
		} break;
 
		case 10: {
 
			if (!IsWindowOfPrototype(w, _player_roadveh_widgets))
 
				break;
ship_gui.c
Show inline comments
 
@@ -1065,24 +1065,10 @@ static void PlayerShipsWndProc(Window *w
 
			}
 
		} break;
 

	
 
		case 9: { /* Build new Vehicle */
 
			TileIndex tile;
 

	
 
		case 9: /* Build new Vehicle */
 
			if (!IsWindowOfPrototype(w, _player_ships_widgets)) break;
 

	
 
			tile = _last_built_ship_depot_tile;
 
			do {
 
				if (IsTileDepotType(tile, TRANSPORT_WATER) && IsTileOwner(tile, _local_player)) {
 
					ShowShipDepotWindow(tile);
 
					ShowBuildShipWindow(tile);
 
					return;
 
				}
 

	
 
				tile = TILE_MASK(tile + 1);
 
			} while (tile != _last_built_ship_depot_tile);
 

	
 
			ShowBuildShipWindow(0);
 
		} break;
 
			break;
 

	
 
		case 10: {
 
			if (!IsWindowOfPrototype(w, _player_ships_widgets)) break;
station_cmd.c
Show inline comments
 
@@ -1669,9 +1669,6 @@ int32 CmdBuildAirport(TileIndex tile, ui
 

	
 
	if (flags & DC_EXEC) {
 
		st->owner = _current_player;
 
		if (IsLocalPlayer() && afc->nof_depots != 0)
 
			_last_built_aircraft_depot_tile = tile + ToTileIndexDiff(afc->airport_depots[0]);
 

	
 
		st->airport_tile = tile;
 
		if (!st->facilities) st->xy = tile;
 
		st->facilities |= FACIL_AIRPORT;
train_gui.c
Show inline comments
 
@@ -1494,26 +1494,11 @@ static void PlayerTrainsWndProc(Window *
 
			}
 
		} break;
 

	
 
		case 9: { /* Build new Vehicle */
 
			TileIndex tile;
 

	
 
			if (!IsWindowOfPrototype(w, _player_trains_widgets))
 
				break;
 
		case 9: /* Build new Vehicle */
 
			if (!IsWindowOfPrototype(w, _player_trains_widgets)) break;
 
			ShowBuildTrainWindow(0);
 
			break;
 

	
 
			tile = _last_built_train_depot_tile;
 
			do {
 
				if (IsTileDepotType(tile, TRANSPORT_RAIL) &&
 
						IsTileOwner(tile, _local_player)) {
 
					ShowTrainDepotWindow(tile);
 
					ShowBuildTrainWindow(tile);
 
					return;
 
				}
 

	
 
				tile = TILE_MASK(tile + 1);
 
			} while (tile != _last_built_train_depot_tile);
 

	
 
			ShowBuildTrainWindow(0);
 
		} break;
 
		case 10: {
 
			if (!IsWindowOfPrototype(w, _player_trains_widgets))
 
				break;
water_cmd.c
Show inline comments
 
@@ -78,7 +78,6 @@ int32 CmdBuildShipDepot(TileIndex tile, 
 

	
 
	if (flags & DC_EXEC) {
 
		depot->xy = tile;
 
		_last_built_ship_depot_tile = tile;
 
		depot->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
 

	
 
		MakeShipDepot(tile,_current_player, DEPOT_NORTH, p1);
 
@@ -698,10 +697,6 @@ static uint32 VehicleEnter_Water(Vehicle
 
	return 0;
 
}
 

	
 
void InitializeDock(void)
 
{
 
	_last_built_ship_depot_tile = 0;
 
}
 

	
 
const TileTypeProcs _tile_type_water_procs = {
 
	DrawTile_Water,						/* draw_tile_proc */
0 comments (0 inline, 0 general)