summaryrefslogtreecommitdiff
path: root/macros.h
diff options
context:
space:
mode:
authorCelestar <celestar@openttd.org>2004-12-08 15:46:13 +0000
committerCelestar <celestar@openttd.org>2004-12-08 15:46:13 +0000
commit5b0743d66bf73a1bbfdd95beca039283091d8d46 (patch)
treeaa862fd953b81bbc7c142d763f82868807933f7e /macros.h
parent6fd3fc10e347695b28c8b3d1e0074b5456cd8100 (diff)
downloadopenttd-5b0743d66bf73a1bbfdd95beca039283091d8d46.tar.xz
(svn r979) Allow more realistically sized catchment areas
Diffstat (limited to 'macros.h')
-rw-r--r--macros.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/macros.h b/macros.h
index 11d01d2b8..7517d6fed 100644
--- a/macros.h
+++ b/macros.h
@@ -173,6 +173,16 @@ static inline int FindFirstBit2x64(int value)
#define CHANCE16R(a,b,r) ((uint16)(r=Random()) <= (uint16)((65536 * a) / b))
#define CHANCE16I(a,b,v) ((uint16)(v) <= (uint16)((65536 * a) / b))
+#define FIND_CATCHMENT_RADIUS(st,rad) \
+ {\
+ if (st->bus_tile || st->lorry_tile || (st->airport_tile && st->airport_type == AT_OILRIG)) rad = 3; \
+ if (st->train_tile || (st->airport_tile && (st->airport_type == AT_HELIPORT || st->airport_type == AT_SMALL))) rad = 4; \
+ if (st->dock_tile || (st->airport_tile && st->airport_type == AT_LARGE)) rad = 5; \
+ if (st->airport_tile && st->airport_type == AT_METROPOLITAN) rad = 6; \
+ if (st->airport_tile && st->airport_type == AT_INTERNATIONAL) rad = 8; }
+
+
+
#define BEGIN_TILE_LOOP(var,w,h,tile) \
{int h_cur = h; \
uint var = tile; \