mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-08 23:34:15 +00:00
(svn r23284) -Fix [FS#4845]: Pathfinders go haywire when you build a lock over a ship going perpendicular to the axis of the new lock
This commit is contained in:
parent
18a0dc894d
commit
56a2c4b177
@ -205,12 +205,17 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag
|
||||
{
|
||||
CommandCost cost(EXPENSES_CONSTRUCTION);
|
||||
|
||||
int delta = TileOffsByDiagDir(dir);
|
||||
CommandCost ret = EnsureNoVehicleOnGround(tile);
|
||||
if (ret.Succeeded()) ret = EnsureNoVehicleOnGround(tile + delta);
|
||||
if (ret.Succeeded()) ret = EnsureNoVehicleOnGround(tile - delta);
|
||||
if (ret.Failed()) return ret;
|
||||
|
||||
/* middle tile */
|
||||
CommandCost ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||
ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||
if (ret.Failed()) return ret;
|
||||
cost.AddCost(ret);
|
||||
|
||||
int delta = TileOffsByDiagDir(dir);
|
||||
/* lower tile */
|
||||
WaterClass wc_lower = IsWaterTile(tile - delta) ? GetWaterClass(tile - delta) : WATER_CLASS_CANAL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user