Changeset - r5991:254bad51c6b2
[Not reviewed]
master
0 11 0
rubidium - 17 years ago 2007-02-13 10:26:53
rubidium@openttd.org
(svn r8698) -Codechange: enumify the returns of VehicleEnterTile
11 files changed with 67 insertions and 51 deletions:
0 comments (0 inline, 0 general)
src/openttd.h
Show inline comments
 
@@ -358,16 +358,13 @@ typedef void GetTileDescProc(TileIndex t
 
typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode);
 
typedef void GetProducedCargoProc(TileIndex tile, CargoID *b);
 
typedef void ClickTileProc(TileIndex tile);
 
typedef void AnimateTileProc(TileIndex tile);
 
typedef void TileLoopProc(TileIndex tile);
 
typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player);
 
/* Return value has bit 0x2 set, when the vehicle enters a station. Then,
 
 * result << 8 contains the id of the station entered. If the return value has
 
 * bit 0x8 set, the vehicle could not and did not enter the tile. Are there
 
 * other bits that can be set? */
 
/** @see VehicleEnterTileStatus to see what the return values mean */
 
typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
 
typedef Slope GetSlopeTilehProc(TileIndex, Slope tileh);
 

	
 
typedef struct {
 
	DrawTileProc *draw_tile_proc;
 
	GetSlopeZProc *get_slope_z_proc;
src/rail_cmd.cpp
Show inline comments
 
@@ -1943,13 +1943,13 @@ static uint32 VehicleEnter_Track(Vehicle
 
	byte fract_coord;
 
	byte fract_coord_leave;
 
	DiagDirection dir;
 
	int length;
 

	
 
	// this routine applies only to trains in depot tiles
 
	if (v->type != VEH_Train || !IsTileDepotType(tile, TRANSPORT_RAIL)) return 0;
 
	if (v->type != VEH_Train || !IsTileDepotType(tile, TRANSPORT_RAIL)) return VETSB_CONTINUE;
 

	
 
	/* depot direction */
 
	dir = GetRailDepotDirection(tile);
 

	
 
	/* calculate the point where the following wagon should be activated */
 
	/* this depends on the length of the current vehicle */
 
@@ -1962,36 +1962,36 @@ static uint32 VehicleEnter_Track(Vehicle
 
			((length + 1) * _deltacoord_leaveoffset[dir+4])) << 4);
 

	
 
	fract_coord = (x & 0xF) + ((y & 0xF) << 4);
 

	
 
	if (_fractcoords_behind[dir] == fract_coord) {
 
		/* make sure a train is not entering the tile from behind */
 
		return 8;
 
		return VETSB_CANNOT_ENTER;
 
	} else if (_fractcoords_enter[dir] == fract_coord) {
 
		if (DiagDirToDir(ReverseDiagDir(dir)) == v->direction) {
 
			/* enter the depot */
 
			v->u.rail.track = TRACK_BIT_SPECIAL,
 
			v->vehstatus |= VS_HIDDEN; /* hide it */
 
			v->direction = ReverseDir(v->direction);
 
			if (v->next == NULL) VehicleEnterDepot(v);
 
			v->tile = tile;
 

	
 
			InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
 
			return 4;
 
			return VETSB_ENTERED_WORMHOLE;
 
		}
 
	} else if (fract_coord_leave == fract_coord) {
 
		if (DiagDirToDir(dir) == v->direction) {
 
			/* leave the depot? */
 
			if ((v = v->next) != NULL) {
 
				v->vehstatus &= ~VS_HIDDEN;
 
				v->u.rail.track = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y);
 
			}
 
		}
 
	}
 

	
 
	return 0;
 
	return VETSB_CONTINUE;
 
}
 

	
 

	
 
extern const TileTypeProcs _tile_type_rail_procs = {
 
	DrawTile_Track,           /* draw_tile_proc */
 
	GetSlopeZ_Track,          /* get_slope_z_proc */
src/road_cmd.cpp
Show inline comments
 
@@ -1013,19 +1013,19 @@ static uint32 VehicleEnter_Road(Vehicle 
 

	
 
		case ROAD_TILE_DEPOT:
 
			if (v->type == VEH_Road &&
 
					v->u.road.frame == 11 &&
 
					_roadveh_enter_depot_unk0[GetRoadDepotDirection(tile)] == v->u.road.state) {
 
				VehicleEnterDepot(v);
 
				return 4;
 
				return VETSB_ENTERED_WORMHOLE;
 
			}
 
			break;
 

	
 
		default: break;
 
	}
 
	return 0;
 
	return VETSB_CONTINUE;
 
}
 

	
 

	
 
static void ChangeTileOwner_Road(TileIndex tile, PlayerID old_player, PlayerID new_player)
 
{
 
	if (IsLevelCrossing(tile) && GetCrossingRoadOwner(tile) == old_player) {
src/roadveh_cmd.cpp
Show inline comments
 
@@ -1337,13 +1337,13 @@ static void RoadVehController(Vehicle *v
 
		const Vehicle *u = RoadVehFindCloseTo(v, gp.x, gp.y, v->direction);
 
		if (u != NULL && u->cur_speed < v->cur_speed) {
 
			v->cur_speed = u->cur_speed;
 
			return;
 
		}
 

	
 
		if ((IsTunnelTile(gp.new_tile) || IsBridgeTile(gp.new_tile)) && VehicleEnterTile(v, gp.new_tile, gp.x, gp.y) & 4) {
 
		if ((IsTunnelTile(gp.new_tile) || IsBridgeTile(gp.new_tile)) && HASBIT(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
 
			/* Vehicle has just entered a bridge or tunnel */
 
			v->cur_image = GetRoadVehImage(v, v->direction);
 
			UpdateRoadVehDeltaXY(v);
 
			SetRoadVehPosition(v,gp.x,gp.y);
 
			return;
 
		}
 
@@ -1385,13 +1385,13 @@ again:
 
		y = TileY(tile) * TILE_SIZE + rdp[0].y;
 

	
 
		newdir = RoadVehGetSlidingDirection(v, x, y);
 
		if (RoadVehFindCloseTo(v, x, y, newdir) != NULL) return;
 

	
 
		r = VehicleEnterTile(v, tile, x, y);
 
		if (r & 8) {
 
		if (HASBIT(r, VETS_CANNOT_ENTER)) {
 
			/* Vehicle cannot enter the tile */
 
			if (!IsTileType(tile, MP_TUNNELBRIDGE)) {
 
				v->cur_speed = 0;
 
				return;
 
			}
 
			/* Try an about turn to re-enter the previous tile */
 
@@ -1413,13 +1413,13 @@ again:
 
				/* Vehicle is leaving a road stop tile, mark bay as free and clear the usage bit */
 
				rs->FreeBay(HASBIT(v->u.road.state, 1) ? 1 : 0);
 
				rs->SetEntranceBusy(false);
 
			}
 
		}
 

	
 
		if (!(r & 4)) {
 
		if (!HASBIT(r, VETS_ENTERED_WORMHOLE)) {
 
			/* Set vehicle to first frame on new tile */
 
			v->tile = tile;
 
			v->u.road.state = (byte)dir;
 
			v->u.road.frame = 0;
 
		}
 
		if (newdir != v->direction) {
 
@@ -1454,13 +1454,13 @@ again:
 
		y = TileY(v->tile) * TILE_SIZE + rdp[1].y;
 

	
 
		newdir = RoadVehGetSlidingDirection(v, x, y);
 
		if (RoadVehFindCloseTo(v, x, y, newdir) != NULL) return;
 

	
 
		r = VehicleEnterTile(v, v->tile, x, y);
 
		if (r & 8) {
 
		if (HASBIT(r, VETS_CANNOT_ENTER)) {
 
			/* Vehicle cannot enter the tile */
 
			v->cur_speed = 0;
 
			return;
 
		}
 

	
 
		/* Set vehicle to second frame on the tile */
 
@@ -1596,21 +1596,21 @@ again:
 
		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
 
	}
 

	
 
	/* Check tile position conditions - i.e. stop position in depot,
 
	 * entry onto bridge or into tunnel */
 
	r = VehicleEnterTile(v, v->tile, x, y);
 
	if (r & 8) {
 
	if (HASBIT(r, VETS_CANNOT_ENTER)) {
 
		/* Vehicle cannot continue */
 
		v->cur_speed = 0;
 
		return;
 
	}
 

	
 
	/* Move to next frame unless vehicle arrived at a stop position
 
	 * in a depot or entered a tunnel/bridge */
 
	if ((r & 4) == 0) v->u.road.frame++;
 
	if (!HASBIT(r, VETS_ENTERED_WORMHOLE)) v->u.road.frame++;
 

	
 
	v->cur_image = GetRoadVehImage(v, v->direction);
 
	UpdateRoadVehDeltaXY(v);
 
	RoadZPosAffectSpeed(v, SetRoadVehPosition(v, x, y));
 
}
 

	
src/ship_cmd.cpp
Show inline comments
 
@@ -697,13 +697,13 @@ static void ShipController(Vehicle *v)
 
		if (IsShipInDepot(v)) {
 
			gp.x = v->x_pos;
 
			gp.y = v->y_pos;
 
		} else {
 
			/* isnot inside depot */
 
			r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
 
			if (r & 0x8) goto reverse_direction;
 
			if (HASBIT(r, VETS_CANNOT_ENTER)) goto reverse_direction;
 

	
 
			/* A leave station order only needs one tick to get processed, so we can
 
			 * always skip ahead. */
 
			if (v->current_order.type == OT_LEAVESTATION) {
 
				v->current_order.type = OT_NOTHING;
 
				v->current_order.flags = 0;
 
@@ -777,15 +777,15 @@ static void ShipController(Vehicle *v)
 

	
 
		gp.x = (gp.x&~0xF) | b[0];
 
		gp.y = (gp.y&~0xF) | b[1];
 

	
 
		/* Call the landscape function and tell it that the vehicle entered the tile */
 
		r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
 
		if (r&0x8) goto reverse_direction;
 
		if (HASBIT(r, VETS_CANNOT_ENTER)) goto reverse_direction;
 

	
 
		if (!(r&0x4)) {
 
		if (!HASBIT(r, VETS_ENTERED_WORMHOLE)) {
 
			v->tile = gp.new_tile;
 
			v->u.ship.state = TrackToTrackBits(track);
 
		}
 

	
 
		v->direction = (Direction)b[2];
 
	}
src/station_cmd.cpp
Show inline comments
 
@@ -2257,13 +2257,13 @@ static uint32 VehicleEnter_Station(Vehic
 
					x &= 0xF;
 
					y &= 0xF;
 

	
 
					if (DiagDirToAxis(dir) != AXIS_X) intswap(x, y);
 
					if (y == TILE_SIZE / 2) {
 
						if (dir != DIAGDIR_SE && dir != DIAGDIR_SW) x = TILE_SIZE - 1 - x;
 
						if (x == 12) return 2 | (station_id << 8); /* enter station */
 
						if (x == 12) return VETSB_ENTERED_STATION | (station_id << VETS_STATION_ID_OFFSET); /* enter station */
 
						if (x < 12) {
 
							uint16 spd;
 

	
 
							v->vehstatus |= VS_TRAIN_SLOWING;
 
							spd = _enter_station_speedtable[x];
 
							if (spd < v->cur_speed) v->cur_speed = spd;
 
@@ -2276,13 +2276,13 @@ static uint32 VehicleEnter_Station(Vehic
 
		if (v->u.road.state < 16 && !HASBIT(v->u.road.state, 2) && v->u.road.frame == 0) {
 
			if (IsRoadStop(tile)) {
 
				/* Attempt to allocate a parking bay in a road stop */
 
				RoadStop *rs = GetRoadStopByTile(tile, GetRoadStopType(tile));
 

	
 
				/* Check if station is busy or if there are no free bays. */
 
				if (rs->IsEntranceBusy() || !rs->HasFreeBay()) return 8;
 
				if (rs->IsEntranceBusy() || !rs->HasFreeBay()) return VETSB_CANNOT_ENTER;
 

	
 
				v->u.road.state += 32;
 

	
 
				/* Allocate a bay and update the road state */
 
				uint bay_nr = rs->AllocateBay();
 
				SB(v->u.road.state, 1, 1, bay_nr);
 
@@ -2290,13 +2290,13 @@ static uint32 VehicleEnter_Station(Vehic
 
				/* Mark the station entrace as busy */
 
				rs->SetEntranceBusy(true);
 
			}
 
		}
 
	}
 

	
 
	return 0;
 
	return VETSB_CONTINUE;
 
}
 

	
 
/* this function is called for one station each tick */
 
static void StationHandleBigTick(Station *st)
 
{
 
	UpdateStationAcceptance(st, true);
src/train_cmd.cpp
Show inline comments
 
@@ -3019,18 +3019,17 @@ static void TrainController(Vehicle *v, 
 
				} else {
 
					/* is not inside depot */
 

	
 
					if (IsFrontEngine(v) && !TrainCheckIfLineEnds(v)) return;
 

	
 
					r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
 
					if (r & 0x8) {
 
						//debug("%x & 0x8", r);
 
					if (HASBIT(r, VETS_ENTERED_WORMHOLE)) {
 
						goto invalid_rail;
 
					}
 
					if (r & 0x2) {
 
						TrainEnterStation(v, r >> 8);
 
					if (HASBIT(r, VETS_ENTERED_STATION)) {
 
						TrainEnterStation(v, r >> VETS_STATION_ID_OFFSET);
 
						return;
 
					}
 

	
 
					if (v->current_order.type == OT_LEAVESTATION) {
 
						v->current_order.type = OT_NOTHING;
 
						v->current_order.flags = 0;
 
@@ -3098,25 +3097,24 @@ static void TrainController(Vehicle *v, 
 
					gp.y = (gp.y & ~0xF) | b[1];
 
					chosen_dir = (Direction)b[2];
 
				}
 

	
 
				/* Call the landscape function and tell it that the vehicle entered the tile */
 
				r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
 
				if (r & 0x8) {
 
					//debug("%x & 0x8", r);
 
				if (HASBIT(r, VETS_CANNOT_ENTER)) {
 
					goto invalid_rail;
 
				}
 

	
 
				if (IsLevelCrossingTile(v->tile) && v->next == NULL) {
 
					UnbarCrossing(v->tile);
 
					MarkTileDirtyByTile(v->tile);
 
				}
 

	
 
				if (IsFrontEngine(v)) v->load_unload_time_rem = 0;
 

	
 
				if (!(r&0x4)) {
 
				if (!HASBIT(r, VETS_ENTERED_WORMHOLE)) {
 
					v->tile = gp.new_tile;
 

	
 
					if (GetTileRailType(gp.new_tile, FindFirstTrack(chosen_track)) != GetTileRailType(gp.old_tile, FindFirstTrack(v->u.rail.track))) {
 
						TrainPowerChanged(GetFirstVehicleInChain(v));
 
					}
 

	
 
@@ -3138,13 +3136,13 @@ static void TrainController(Vehicle *v, 
 
		} else {
 
			/* in tunnel on on a bridge */
 
			GetNewVehiclePos(v, &gp);
 

	
 
			SetSpeedLimitOnBridge(v);
 

	
 
			if (!(IsTunnelTile(gp.new_tile) || IsBridgeTile(gp.new_tile)) || !(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y) & 0x4)) {
 
			if (!(IsTunnelTile(gp.new_tile) || IsBridgeTile(gp.new_tile)) || !HASBIT(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
 
				v->x_pos = gp.x;
 
				v->y_pos = gp.y;
 
				VehiclePositionChanged(v);
 
				if (!(v->vehstatus & VS_HIDDEN)) EndVehicleMove(v);
 
				continue;
 
			}
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -1259,13 +1259,13 @@ static const byte _tunnel_fractcoord_6[4
 
static const byte _tunnel_fractcoord_7[4]    = {0x52, 0x85, 0x96, 0x49};
 

	
 
static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y)
 
{
 
	int z = GetSlopeZ(x, y) - v->z_pos;
 

	
 
	if (myabs(z) > 2) return 8;
 
	if (myabs(z) > 2) return VETSB_CANNOT_ENTER;
 

	
 
	if (IsTunnel(tile)) {
 
		byte fc;
 
		DiagDirection dir;
 
		DiagDirection vdir;
 

	
 
@@ -1277,29 +1277,29 @@ static uint32 VehicleEnter_TunnelBridge(
 

	
 
			if (v->u.rail.track != 0x40 && dir == vdir) {
 
				if (IsFrontEngine(v) && fc == _tunnel_fractcoord_1[dir]) {
 
					if (!PlayVehicleSound(v, VSE_TUNNEL) && v->spritenum < 4) {
 
						SndPlayVehicleFx(SND_05_TRAIN_THROUGH_TUNNEL, v);
 
					}
 
					return 0;
 
					return VETSB_CONTINUE;
 
				}
 
				if (fc == _tunnel_fractcoord_2[dir]) {
 
					v->tile = tile;
 
					v->u.rail.track = TRACK_BIT_WORMHOLE;
 
					v->vehstatus |= VS_HIDDEN;
 
					return 4;
 
					return VETSB_ENTERED_WORMHOLE;
 
				}
 
			}
 

	
 
			if (dir == ReverseDiagDir(vdir) && fc == _tunnel_fractcoord_3[dir] && z == 0) {
 
				/* We're at the tunnel exit ?? */
 
				v->tile = tile;
 
				v->u.rail.track = (TrackBits)_exit_tunnel_track[dir];
 
				assert(v->u.rail.track);
 
				v->vehstatus &= ~VS_HIDDEN;
 
				return 4;
 
				return VETSB_ENTERED_WORMHOLE;
 
			}
 
		} else if (v->type == VEH_Road) {
 
			fc = (x & 0xF) + (y << 4);
 
			dir = GetTunnelDirection(tile);
 
			vdir = DirToDiagDir(v->direction);
 

	
 
@@ -1307,15 +1307,15 @@ static uint32 VehicleEnter_TunnelBridge(
 
			if (v->u.road.state != 0xFF && dir == vdir) {
 
				if (fc == _tunnel_fractcoord_4[dir] ||
 
						fc == _tunnel_fractcoord_5[dir]) {
 
					v->tile = tile;
 
					v->u.road.state = 0xFF;
 
					v->vehstatus |= VS_HIDDEN;
 
					return 4;
 
					return VETSB_ENTERED_WORMHOLE;
 
				} else {
 
					return 0;
 
					return VETSB_CONTINUE;
 
				}
 
			}
 

	
 
			if (dir == ReverseDiagDir(vdir) && (
 
						/* We're at the tunnel exit ?? */
 
						fc == _tunnel_fractcoord_6[dir] ||
 
@@ -1323,13 +1323,13 @@ static uint32 VehicleEnter_TunnelBridge(
 
					) &&
 
					z == 0) {
 
				v->tile = tile;
 
				v->u.road.state = _road_exit_tunnel_state[dir];
 
				v->u.road.frame = _road_exit_tunnel_frame[dir];
 
				v->vehstatus &= ~VS_HIDDEN;
 
				return 4;
 
				return VETSB_ENTERED_WORMHOLE;
 
			}
 
		}
 
	} else if (IsBridge(tile)) { // XXX is this necessary?
 
		DiagDirection dir;
 

	
 
		if (v->type == VEH_Road || (v->type == VEH_Train && IsFrontEngine(v))) {
 
@@ -1341,43 +1341,43 @@ static uint32 VehicleEnter_TunnelBridge(
 
		}
 

	
 
		dir = GetBridgeRampDirection(tile);
 
		if (DirToDiagDir(v->direction) == dir) {
 
			switch (dir) {
 
				default: NOT_REACHED();
 
				case DIAGDIR_NE: if ((x & 0xF) != 0)             return 0; break;
 
				case DIAGDIR_SE: if ((y & 0xF) != TILE_SIZE - 1) return 0; break;
 
				case DIAGDIR_SW: if ((x & 0xF) != TILE_SIZE - 1) return 0; break;
 
				case DIAGDIR_NW: if ((y & 0xF) != 0)             return 0; break;
 
				case DIAGDIR_NE: if ((x & 0xF) != 0)             return VETSB_CONTINUE; break;
 
				case DIAGDIR_SE: if ((y & 0xF) != TILE_SIZE - 1) return VETSB_CONTINUE; break;
 
				case DIAGDIR_SW: if ((x & 0xF) != TILE_SIZE - 1) return VETSB_CONTINUE; break;
 
				case DIAGDIR_NW: if ((y & 0xF) != 0)             return VETSB_CONTINUE; break;
 
			}
 
			if (v->type == VEH_Train) {
 
				v->u.rail.track = TRACK_BIT_WORMHOLE;
 
				CLRBIT(v->u.rail.flags, VRF_GOINGUP);
 
				CLRBIT(v->u.rail.flags, VRF_GOINGDOWN);
 
			} else {
 
				v->u.road.state = 0xFF;
 
			}
 
			return 4;
 
			return VETSB_ENTERED_WORMHOLE;
 
		} else if (DirToDiagDir(v->direction) == ReverseDiagDir(dir)) {
 
			v->tile = tile;
 
			if (v->type == VEH_Train) {
 
				if (v->u.rail.track == 0x40) {
 
					v->u.rail.track = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y);
 
					return 4;
 
					return VETSB_ENTERED_WORMHOLE;
 
				}
 
			} else {
 
				if (v->u.road.state == 0xFF) {
 
					v->u.road.state = _road_exit_tunnel_state[dir];
 
					v->u.road.frame = 0;
 
					return 4;
 
					return VETSB_ENTERED_WORMHOLE;
 
				}
 
			}
 
			return 0;
 
			return VETSB_CONTINUE;
 
		}
 
	}
 
	return 0;
 
	return VETSB_CONTINUE;
 
}
 

	
 
extern const TileTypeProcs _tile_type_tunnelbridge_procs = {
 
	DrawTile_TunnelBridge,           /* draw_tile_proc */
 
	GetSlopeZ_TunnelBridge,          /* get_slope_z_proc */
 
	ClearTile_TunnelBridge,          /* clear_tile_proc */
src/vehicle.cpp
Show inline comments
 
@@ -2766,16 +2766,17 @@ Trackdir GetVehicleTrackdir(const Vehicl
 
			return DiagdirToDiagTrackdir(DirToDiagDir(v->direction));
 

	
 
		/* case VEH_Aircraft: case VEH_Special: case VEH_Disaster: */
 
		default: return INVALID_TRACKDIR;
 
	}
 
}
 
/* Return value has bit 0x2 set, when the vehicle enters a station. Then,
 
 * result << 8 contains the id of the station entered. If the return value has
 
 * bit 0x8 set, the vehicle could not and did not enter the tile. Are there
 
 * other bits that can be set? */
 

	
 
/**
 
 * Returns some meta-data over the to be entered tile.
 
 * @see VehicleEnterTileStatus to see what the bits in the return value mean.
 
 */
 
uint32 VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y)
 
{
 
	return _tile_type_procs[GetTileType(tile)]->vehicle_enter_tile_proc(v, tile, x, y);
 
}
 

	
 
UnitID GetFreeUnitNumber(byte type)
src/vehicle.h
Show inline comments
 
@@ -4,12 +4,32 @@
 
#define VEHICLE_H
 

	
 
#include "oldpool.h"
 
#include "order.h"
 
#include "rail.h"
 

	
 
/** The returned bits of VehicleEnterTile. */
 
enum VehicleEnterTileStatus {
 
	VETS_ENTERED_STATION  = 1, ///< The vehicle entered a station
 
	VETS_ENTERED_WORMHOLE = 2, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
 
	VETS_CANNOT_ENTER     = 3, ///< The vehicle cannot enter the tile
 

	
 
	/**
 
	 * Shift the VehicleEnterTileStatus this many bits
 
	 * to the right to get the station ID when
 
	 * VETS_ENTERED_STATION is set
 
	 */
 
	VETS_STATION_ID_OFFSET = 8,
 

	
 
	/** Bit sets of the above specified bits */
 
	VETSB_CONTINUE         = 0,                          ///< The vehicle can continue normally
 
	VETSB_ENTERED_STATION  = 1 << VETS_ENTERED_STATION,  ///< The vehicle entered a station
 
	VETSB_ENTERED_WORMHOLE = 1 << VETS_ENTERED_WORMHOLE, ///< The vehicle either entered a bridge, tunnel or depot tile (this includes the last tile of the bridge/tunnel)
 
	VETSB_CANNOT_ENTER     = 1 << VETS_CANNOT_ENTER,     ///< The vehicle cannot enter the tile
 
};
 

	
 
enum {
 
	VEH_Train,
 
	VEH_Road,
 
	VEH_Ship,
 
	VEH_Aircraft,
 
	VEH_Special,
src/water_cmd.cpp
Show inline comments
 
@@ -739,13 +739,13 @@ static void ChangeTileOwner_Water(TileIn
 
		DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
 
	}
 
}
 

	
 
static uint32 VehicleEnter_Water(Vehicle *v, TileIndex tile, int x, int y)
 
{
 
	return 0;
 
	return VETSB_CONTINUE;
 
}
 

	
 

	
 
extern const TileTypeProcs _tile_type_water_procs = {
 
	DrawTile_Water,           /* draw_tile_proc */
 
	GetSlopeZ_Water,          /* get_slope_z_proc */
0 comments (0 inline, 0 general)