Mercurial > hg > openttd
changeset 1058:26e926ec95fd draft
(svn r1559) Use IsTileType() instead of bit shifting and comparisons
author | tron <tron@openttd.org> |
---|---|
date | Tue, 18 Jan 2005 17:19:34 +0000 |
parents | ca0b3e577ed7 |
children | 06bb16255989 |
files | vehicle.c |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/vehicle.c +++ b/vehicle.c @@ -514,15 +514,16 @@ bool CanFillVehicle(Vehicle *v) { - byte *t = &_map_type_and_height[v->tile]; + TileIndex tile = v->tile; - if (t[0] >> 4 == MP_STATION || - (v->type == VEH_Ship && - (t[TILE_XY(1,0)] >> 4 == MP_STATION || - t[TILE_XY(-1,0)] >> 4 == MP_STATION || - t[TILE_XY(0,1)] >> 4 == MP_STATION || - t[TILE_XY(0,-1)] >> 4 == MP_STATION || - t[TILE_XY(-2,0)] >> 4 == MP_STATION))) { + if (IsTileType(tile, MP_STATION) || + (v->type == VEH_Ship && ( + IsTileType(TILE_ADDXY(tile, 1, 0), MP_STATION) || + IsTileType(TILE_ADDXY(tile, -1, 0), MP_STATION) || + IsTileType(TILE_ADDXY(tile, 0, 1), MP_STATION) || + IsTileType(TILE_ADDXY(tile, 0, -1), MP_STATION) || + IsTileType(TILE_ADDXY(tile, -2, 0), MP_STATION) + ))) { // If patch is active, use alternative CanFillVehicle-function if (_patches.full_load_any)