mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r19436) -Fix: With certain game settings one could clear tiles for free when building long roads.
This commit is contained in:
parent
05d29d8a3d
commit
7bf13ea692
@ -608,7 +608,7 @@ CommandCost CmdBuildRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
|||||||
|
|
||||||
default: {
|
default: {
|
||||||
do_clear:;
|
do_clear:;
|
||||||
CommandCost ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
CommandCost ret = DoCommand(tile, 0, 0, flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR);
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
cost.AddCost(ret);
|
cost.AddCost(ret);
|
||||||
tile_cleared = true;
|
tile_cleared = true;
|
||||||
@ -661,6 +661,10 @@ do_clear:;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
/* CmdBuildLongRoad calls us directly with DC_EXEC, so we may only clear the tile after all
|
||||||
|
* fail/success tests have been done. */
|
||||||
|
if (tile_cleared) DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
||||||
|
|
||||||
switch (GetTileType(tile)) {
|
switch (GetTileType(tile)) {
|
||||||
case MP_ROAD: {
|
case MP_ROAD: {
|
||||||
RoadTileType rtt = GetRoadTileType(tile);
|
RoadTileType rtt = GetRoadTileType(tile);
|
||||||
|
Loading…
Reference in New Issue
Block a user