From b2dd47f565d5ba9d92f808ce2e822c23cf562f78 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 28 Mar 2005 18:59:33 +0000 Subject: (svn r2102) Fix bug introduced in r2038, which gave you money for clearing occupied railway tiles ([1171926]) --- rail_cmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rail_cmd.c b/rail_cmd.c index 6c0d1890d..57c882fbd 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -1070,6 +1070,10 @@ static int32 ClearTile_Track(TileIndex tile, byte flags) } m5 &= RAIL_BIT_MASK; + if (!(flags & DC_EXEC)) { + for (; m5 != 0; m5 >>= 1) if (m5 & 1) cost += _price.remove_rail; + return cost; + } /* FALLTHROUGH */ case RAIL_TYPE_NORMAL: { @@ -1077,12 +1081,8 @@ static int32 ClearTile_Track(TileIndex tile, byte flags) for (i = 0; m5 != 0; i++, m5 >>= 1) { if (m5 & 1) { - if (flags & DC_EXEC) { - ret = DoCommandByTile(tile, 0, i, flags, CMD_REMOVE_SINGLE_RAIL); - if (ret == CMD_ERROR) return CMD_ERROR; - } else { - ret = _price.remove_rail; - } + ret = DoCommandByTile(tile, 0, i, flags, CMD_REMOVE_SINGLE_RAIL); + if (ret == CMD_ERROR) return CMD_ERROR; cost += ret; } } -- cgit v1.2.3-70-g09d2