mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-19 18:35:48 +01:00
(svn r3228) - Fix: [ 1327011 ] Fix: don't lower land on tunnel, even with diag tracks on it (based on patch by glx)
This commit is contained in:
parent
4845ff063b
commit
f6ddaf6a23
18
clear_cmd.c
18
clear_cmd.c
@ -86,7 +86,7 @@ static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile)
|
|||||||
static int TerraformProc(TerraformerState *ts, TileIndex tile, int mode)
|
static int TerraformProc(TerraformerState *ts, TileIndex tile, int mode)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
int32 ret;
|
bool skip_clear = false;
|
||||||
|
|
||||||
assert(tile < MapSize());
|
assert(tile < MapSize());
|
||||||
|
|
||||||
@ -111,18 +111,20 @@ static int TerraformProc(TerraformerState *ts, TileIndex tile, int mode)
|
|||||||
|
|
||||||
// If we have a single diagonal track there, the other side of
|
// If we have a single diagonal track there, the other side of
|
||||||
// tile can be terraformed.
|
// tile can be terraformed.
|
||||||
if ((_m[tile].m5 & ~0x40) == _railway_modes[mode]) return 0;
|
if ((_m[tile].m5 & ~0x40) == _railway_modes[mode]) skip_clear = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = DoCommandByTile(tile, 0,0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR);
|
if (!skip_clear) {
|
||||||
|
int32 ret = DoCommandByTile(tile, 0,0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR);
|
||||||
|
|
||||||
if (ret == CMD_ERROR) {
|
if (CmdFailed(ret)) {
|
||||||
_terraform_err_tile = tile;
|
_terraform_err_tile = tile;
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ts->cost += ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
ts->cost += ret;
|
|
||||||
|
|
||||||
if (ts->tile_table_count >= 625) return -1;
|
if (ts->tile_table_count >= 625) return -1;
|
||||||
ts->tile_table[ts->tile_table_count++] = tile;
|
ts->tile_table[ts->tile_table_count++] = tile;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user