src/rail_cmd.cpp
changeset 7988 6075538f6111
parent 7944 65c7c2e1bcb9
child 7990 70039e33e893
equal deleted inserted replaced
7987:b3627df3493a 7988:6075538f6111
  2154 		if (DiagDirToDir(ReverseDiagDir(dir)) == v->direction) {
  2154 		if (DiagDirToDir(ReverseDiagDir(dir)) == v->direction) {
  2155 			/* enter the depot */
  2155 			/* enter the depot */
  2156 			v->u.rail.track = TRACK_BIT_DEPOT,
  2156 			v->u.rail.track = TRACK_BIT_DEPOT,
  2157 			v->vehstatus |= VS_HIDDEN; /* hide it */
  2157 			v->vehstatus |= VS_HIDDEN; /* hide it */
  2158 			v->direction = ReverseDir(v->direction);
  2158 			v->direction = ReverseDir(v->direction);
  2159 			if (v->next == NULL) VehicleEnterDepot(v);
  2159 			if (v->Next() == NULL) VehicleEnterDepot(v);
  2160 			v->tile = tile;
  2160 			v->tile = tile;
  2161 
  2161 
  2162 			InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
  2162 			InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
  2163 			return VETSB_ENTERED_WORMHOLE;
  2163 			return VETSB_ENTERED_WORMHOLE;
  2164 		}
  2164 		}
  2165 	} else if (fract_coord_leave == fract_coord) {
  2165 	} else if (fract_coord_leave == fract_coord) {
  2166 		if (DiagDirToDir(dir) == v->direction) {
  2166 		if (DiagDirToDir(dir) == v->direction) {
  2167 			/* leave the depot? */
  2167 			/* leave the depot? */
  2168 			if ((v = v->next) != NULL) {
  2168 			if ((v = v->Next()) != NULL) {
  2169 				v->vehstatus &= ~VS_HIDDEN;
  2169 				v->vehstatus &= ~VS_HIDDEN;
  2170 				v->u.rail.track = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y);
  2170 				v->u.rail.track = (DiagDirToAxis(dir) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y);
  2171 			}
  2171 			}
  2172 		}
  2172 		}
  2173 	}
  2173 	}