summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-03 21:26:09 +0000
committerdarkvater <darkvater@openttd.org>2005-01-03 21:26:09 +0000
commit52c87a0330eb4ef533030e8fd18fb349550974cc (patch)
tree6a8389669a7739afd99e94613049a61881c405c5
parent1ee725ef3500348f00d86b9aa42e0ff0e064a737 (diff)
downloadopenttd-52c87a0330eb4ef533030e8fd18fb349550974cc.tar.xz
(svn r1353) -Fix: [1092707] placing rocks in scenario editor. You can place rocks on trees and vice versa
-rw-r--r--main_gui.c5
-rw-r--r--tree_cmd.c4
2 files changed, 4 insertions, 5 deletions
diff --git a/main_gui.c b/main_gui.c
index 6e8a5e04e..91c7bcc48 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -1202,11 +1202,10 @@ static void PlaceProc_LowerBigLand(uint tile)
static void PlaceProc_RockyArea(uint tile)
{
- if (!IS_TILETYPE(tile, MP_CLEAR))
+ if (!IS_TILETYPE(tile, MP_CLEAR) && !IS_TILETYPE(tile, MP_TREES))
return;
- _map5[tile] = (_map5[tile] & ~0x1C) | 0xB;
- MarkTileDirtyByTile(tile);
+ ModifyTile(tile, MP_SETTYPE(MP_CLEAR) | MP_MAP5, (_map5[tile] & ~0x1C) | 0xB);
SndPlayTileFx(SND_1F_SPLAT, tile);
}
diff --git a/tree_cmd.c b/tree_cmd.c
index e5067e612..3aa315056 100644
--- a/tree_cmd.c
+++ b/tree_cmd.c
@@ -181,14 +181,14 @@ int32 CmdPlantTree(int ex, int ey, uint32 flags, uint32 p1, uint32 p2)
// 2x as expensive to add more trees to an existing tile
cost += _price.build_trees * 2;
} else {
- // don't allow building on rocks
- if (ti.type != MP_CLEAR || _map_owner[ti.tile] != OWNER_NONE || (ti.map5 & 0x1C) == 8) {
+ if (ti.type != MP_CLEAR || _map_owner[ti.tile] != OWNER_NONE) {
_error_message = STR_2804_SITE_UNSUITABLE;
continue;
}
// it's expensive to clear farmland
if ((ti.map5 & 0x1F) == 0xF) cost += _price.clear_3;
+ else if ((ti.map5 & 0x1C) == 8) cost += _price.clear_2;
if (flags & DC_EXEC) {
int m2;