summaryrefslogtreecommitdiff
path: root/industry_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-01 15:31:21 +0000
committertron <tron@openttd.org>2006-02-01 15:31:21 +0000
commitac4f4e30d59aa3661128d51e2a34b7d0a4958de8 (patch)
tree4e04e1c3dec5248c24a59e01843c70d577ff6f1a /industry_cmd.c
parent2b9850969279c76e1739c432854121b0e6d4070f (diff)
downloadopenttd-ac4f4e30d59aa3661128d51e2a34b7d0a4958de8.tar.xz
(svn r3514) -Codechange: Replace direct fiddling of bits for the ground type and density of clear tiles with symbolic names and accessors.
See clear.h for details
Diffstat (limited to 'industry_cmd.c')
-rw-r--r--industry_cmd.c27
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;
}
}