Changeset - r1058:c32d04c0e105
[Not reviewed]
master
0 1 0
tron - 19 years ago 2005-01-18 17:19:34
tron@openttd.org
(svn r1559) Use IsTileType() instead of bit shifting and comparisons
1 file changed with 9 insertions and 8 deletions:
0 comments (0 inline, 0 general)
vehicle.c
Show inline comments
 
@@ -514,15 +514,16 @@ static bool CanFillVehicle_FullLoadAny(V
 

	
 
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)
0 comments (0 inline, 0 general)