mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-20 04:59:11 +00:00
Compare commits
2 Commits
b4b2fad8e0
...
7db756e602
Author | SHA1 | Date | |
---|---|---|---|
|
7db756e602 | ||
|
fa82dd6096 |
@@ -30,6 +30,7 @@
|
||||
#include "core/random_func.hpp"
|
||||
#include "object_base.h"
|
||||
#include "company_func.h"
|
||||
#include "company_gui.h"
|
||||
#include "pathfinder/aystar.h"
|
||||
#include "saveload/saveload.h"
|
||||
#include "framerate_type.h"
|
||||
@@ -680,7 +681,16 @@ CommandCost CmdLandscapeClear(DoCommandFlag flags, TileIndex tile)
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
if (c != nullptr) c->clear_limit -= 1 << 16;
|
||||
if (do_clear) DoClearSquare(tile);
|
||||
if (do_clear) {
|
||||
if (IsWaterTile(tile) && IsCanal(tile)) {
|
||||
Owner owner = GetTileOwner(tile);
|
||||
if (Company::IsValidID(owner)) {
|
||||
Company::Get(owner)->infrastructure.water--;
|
||||
DirtyCompanyInfrastructureWindows(owner);
|
||||
}
|
||||
}
|
||||
DoClearSquare(tile);
|
||||
}
|
||||
}
|
||||
return cost;
|
||||
}
|
||||
|
@@ -148,7 +148,12 @@ void CcRailDepot(Commands, const CommandCost &result, TileIndex tile, RailType,
|
||||
|
||||
if (IsTileType(tile, MP_RAILWAY)) {
|
||||
PlaceExtraDepotRail(tile, _place_depot_extra_dir[dir], _place_depot_extra_track[dir]);
|
||||
PlaceExtraDepotRail(tile, _place_depot_extra_dir[dir + 4], _place_depot_extra_track[dir + 4]);
|
||||
|
||||
/* Don't place the rail straight out of the depot of there is another depot across from it. */
|
||||
Tile double_depot_tile = tile + TileOffsByDiagDir(dir);
|
||||
bool is_double_depot = IsValidTile(double_depot_tile) && IsRailDepotTile(double_depot_tile);
|
||||
if (!is_double_depot) PlaceExtraDepotRail(tile, _place_depot_extra_dir[dir + 4], _place_depot_extra_track[dir + 4]);
|
||||
|
||||
PlaceExtraDepotRail(tile, _place_depot_extra_dir[dir + 8], _place_depot_extra_track[dir + 8]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user