src/station_cmd.cpp
branchNewGRF_ports
changeset 10210 a2131f7a315d
parent 10184 fcf5fb2548eb
child 10242 52b4a9006029
equal deleted inserted replaced
10200:aba3af04cdbd 10210:a2131f7a315d
  2310 		} else {
  2310 		} else {
  2311 			image += relocation;
  2311 			image += relocation;
  2312 		}
  2312 		}
  2313 
  2313 
  2314 		SpriteID pal;
  2314 		SpriteID pal;
  2315 		if (!(!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)) && HasBit(image, PALETTE_MODIFIER_COLOR)) {
  2315 		if (HasBit(image, PALETTE_MODIFIER_TRANSPARENT) || HasBit(image, PALETTE_MODIFIER_COLOR)) {
  2316 			pal = palette;
  2316 			if (dtss->image.pal > 0) {
       
  2317 				pal = dtss->image.pal;
       
  2318 			} else {
       
  2319 				pal = palette;
       
  2320 			}
  2317 		} else {
  2321 		} else {
  2318 			pal = dtss->image.pal;
  2322 			pal = PAL_NONE;
  2319 		}
  2323 		}
  2320 
  2324 
  2321 		if ((byte)dtss->delta_z != 0x80) {
  2325 		if ((byte)dtss->delta_z != 0x80) {
  2322 			AddSortableSpriteToDraw(
  2326 			AddSortableSpriteToDraw(
  2323 				image, pal,
  2327 				image, pal,
  2515 };
  2519 };
  2516 
  2520 
  2517 static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
  2521 static VehicleEnterTileStatus VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
  2518 {
  2522 {
  2519 	StationID station_id = GetStationIndex(tile);
  2523 	StationID station_id = GetStationIndex(tile);
  2520 	if (!v->current_order.ShouldStopAtStation(v, station_id)) return VETSB_CONTINUE;
       
  2521 
  2524 
  2522 	if (v->type == VEH_TRAIN) {
  2525 	if (v->type == VEH_TRAIN) {
       
  2526 		if (!v->current_order.ShouldStopAtStation(v, station_id)) return VETSB_CONTINUE;
  2523 		if (IsRailwayStation(tile) && IsFrontEngine(v) &&
  2527 		if (IsRailwayStation(tile) && IsFrontEngine(v) &&
  2524 				!IsCompatibleTrainStationTile(tile + TileOffsByDiagDir(DirToDiagDir(v->direction)), tile)) {
  2528 				!IsCompatibleTrainStationTile(tile + TileOffsByDiagDir(DirToDiagDir(v->direction)), tile)) {
  2525 			DiagDirection dir = DirToDiagDir(v->direction);
  2529 			DiagDirection dir = DirToDiagDir(v->direction);
  2526 
  2530 
  2527 			x &= 0xF;
  2531 			x &= 0xF;
  2545 			if (IsRoadStop(tile) && IsRoadVehFront(v)) {
  2549 			if (IsRoadStop(tile) && IsRoadVehFront(v)) {
  2546 				/* Attempt to allocate a parking bay in a road stop */
  2550 				/* Attempt to allocate a parking bay in a road stop */
  2547 				RoadStop *rs = GetRoadStopByTile(tile, GetRoadStopType(tile));
  2551 				RoadStop *rs = GetRoadStopByTile(tile, GetRoadStopType(tile));
  2548 
  2552 
  2549 				if (IsDriveThroughStopTile(tile)) {
  2553 				if (IsDriveThroughStopTile(tile)) {
       
  2554 					if (!v->current_order.ShouldStopAtStation(v, station_id)) return VETSB_CONTINUE;
       
  2555 
  2550 					/* Vehicles entering a drive-through stop from the 'normal' side use first bay (bay 0). */
  2556 					/* Vehicles entering a drive-through stop from the 'normal' side use first bay (bay 0). */
  2551 					byte side = ((DirToDiagDir(v->direction) == ReverseDiagDir(GetRoadStopDir(tile))) == (v->u.road.overtaking == 0)) ? 0 : 1;
  2557 					byte side = ((DirToDiagDir(v->direction) == ReverseDiagDir(GetRoadStopDir(tile))) == (v->u.road.overtaking == 0)) ? 0 : 1;
  2552 
  2558 
  2553 					if (!rs->IsFreeBay(side)) return VETSB_CANNOT_ENTER;
  2559 					if (!rs->IsFreeBay(side)) return VETSB_CANNOT_ENTER;
  2554 
  2560