|
@@ -23,25 +23,25 @@
|
|
|
#include "sound_func.h"
|
|
|
#include "company_func.h"
|
|
|
#include "clear_map.h"
|
|
|
#include "tree_map.h"
|
|
|
#include "aircraft.h"
|
|
|
#include "effectvehicle_func.h"
|
|
|
#include "tunnelbridge_map.h"
|
|
|
#include "station_base.h"
|
|
|
#include "ai/ai.hpp"
|
|
|
#include "game/game.hpp"
|
|
|
#include "core/random_func.hpp"
|
|
|
#include "core/backup_type.hpp"
|
|
|
#include "date_func.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
#include "company_base.h"
|
|
|
#include "company_gui.h"
|
|
|
#include "newgrf_generic.h"
|
|
|
#include "industry.h"
|
|
|
#include "water_cmd.h"
|
|
|
#include "landscape_cmd.h"
|
|
|
|
|
|
#include "table/strings.h"
|
|
|
|
|
|
#include "safeguards.h"
|
|
|
|
|
|
/**
|
|
@@ -125,25 +125,25 @@ CommandCost CmdBuildShipDepot(DoCommandF
|
|
|
if (add_cost) {
|
|
|
cost.AddCost(ret);
|
|
|
}
|
|
|
add_cost = !IsWaterTile(tile2);
|
|
|
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags | DC_AUTO, tile2);
|
|
|
if (ret.Failed()) return ret;
|
|
|
if (add_cost) {
|
|
|
cost.AddCost(ret);
|
|
|
}
|
|
|
|
|
|
if (flags & DC_EXEC) {
|
|
|
Depot *depot = new Depot(tile);
|
|
|
depot->build_date = _date;
|
|
|
depot->build_date = TimerGameCalendar::date;
|
|
|
|
|
|
uint new_water_infra = 2 * LOCK_DEPOT_TILE_FACTOR;
|
|
|
/* Update infrastructure counts after the tile clears earlier.
|
|
|
* Clearing object tiles may result in water tiles which are already accounted for in the water infrastructure total.
|
|
|
* See: MakeWaterKeepingClass() */
|
|
|
if (wc1 == WATER_CLASS_CANAL && !(HasTileWaterClass(tile) && GetWaterClass(tile) == WATER_CLASS_CANAL && IsTileOwner(tile, _current_company))) new_water_infra++;
|
|
|
if (wc2 == WATER_CLASS_CANAL && !(HasTileWaterClass(tile2) && GetWaterClass(tile2) == WATER_CLASS_CANAL && IsTileOwner(tile2, _current_company))) new_water_infra++;
|
|
|
|
|
|
Company::Get(_current_company)->infrastructure.water += new_water_infra;
|
|
|
DirtyCompanyInfrastructureWindows(_current_company);
|
|
|
|
|
|
MakeShipDepot(tile, _current_company, depot->index, DEPOT_PART_NORTH, axis, wc1);
|