diff options
Diffstat (limited to 'industry_cmd.c')
-rw-r--r-- | industry_cmd.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/industry_cmd.c b/industry_cmd.c index b74c9233f..df21ef5c4 100644 --- a/industry_cmd.c +++ b/industry_cmd.c @@ -2,6 +2,7 @@ #include "stdafx.h" #include "openttd.h" +#include "clear.h" #include "table/strings.h" #include "table/sprites.h" #include "functions.h" @@ -885,32 +886,18 @@ static const byte _plantfarmfield_type[] = {1, 1, 1, 1, 1, 3, 3, 4, 4, 4, 5, 5, static bool IsBadFarmFieldTile(TileIndex tile) { switch (GetTileType(tile)) { - case MP_CLEAR: { - byte m5 = _m[tile].m5 & 0x1C; - return m5 == 0xC || m5 == 0x10; - } - - case MP_TREES: - return false; - - default: - return true; + case MP_CLEAR: return IsClearGround(tile, CL_FIELDS) || IsClearGround(tile, CL_SNOW); + case MP_TREES: return false; + default: return true; } } static bool IsBadFarmFieldTile2(TileIndex tile) { switch (GetTileType(tile)) { - case MP_CLEAR: { - byte m5 = _m[tile].m5 & 0x1C; - return m5 == 0x10; - } - - case MP_TREES: - return false; - - default: - return true; + case MP_CLEAR: return IsClearGround(tile, CL_SNOW); + case MP_TREES: return false; + default: return true; } } |