mirror of https://github.com/OpenTTD/OpenTTD
(svn r1353) -Fix: [1092707] placing rocks in scenario editor. You can place rocks on trees and vice versa
parent
1ee725ef35
commit
52c87a0330
|
@ -1202,11 +1202,10 @@ static void PlaceProc_LowerBigLand(uint tile)
|
||||||
|
|
||||||
static void PlaceProc_RockyArea(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;
|
return;
|
||||||
|
|
||||||
_map5[tile] = (_map5[tile] & ~0x1C) | 0xB;
|
ModifyTile(tile, MP_SETTYPE(MP_CLEAR) | MP_MAP5, (_map5[tile] & ~0x1C) | 0xB);
|
||||||
MarkTileDirtyByTile(tile);
|
|
||||||
SndPlayTileFx(SND_1F_SPLAT, tile);
|
SndPlayTileFx(SND_1F_SPLAT, tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
// 2x as expensive to add more trees to an existing tile
|
||||||
cost += _price.build_trees * 2;
|
cost += _price.build_trees * 2;
|
||||||
} else {
|
} else {
|
||||||
// don't allow building on rocks
|
if (ti.type != MP_CLEAR || _map_owner[ti.tile] != OWNER_NONE) {
|
||||||
if (ti.type != MP_CLEAR || _map_owner[ti.tile] != OWNER_NONE || (ti.map5 & 0x1C) == 8) {
|
|
||||||
_error_message = STR_2804_SITE_UNSUITABLE;
|
_error_message = STR_2804_SITE_UNSUITABLE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// it's expensive to clear farmland
|
// it's expensive to clear farmland
|
||||||
if ((ti.map5 & 0x1F) == 0xF) cost += _price.clear_3;
|
if ((ti.map5 & 0x1F) == 0xF) cost += _price.clear_3;
|
||||||
|
else if ((ti.map5 & 0x1C) == 8) cost += _price.clear_2;
|
||||||
|
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
int m2;
|
int m2;
|
||||||
|
|
Loading…
Reference in New Issue