src/newgrf_station.cpp
changeset 9112 ec6800eaa340
parent 9067 88f2bc991236
child 9191 ae14770c829a
equal deleted inserted replaced
9111:7f882e1856c2 9112:ec6800eaa340
   289 
   289 
   290 	uint32 res = 0;
   290 	uint32 res = 0;
   291 	uint i;
   291 	uint i;
   292 
   292 
   293 	for (i = 0; i < lengthof(x_dir); i++, dir++, diagdir++) {
   293 	for (i = 0; i < lengthof(x_dir); i++, dir++, diagdir++) {
   294 		uint32 ts = GetTileTrackStatus(tile + TileOffsByDir(*dir), TRANSPORT_RAIL, 0);
   294 		TrackBits trackbits = TrackStatusToTrackBits(GetTileTrackStatus(tile + TileOffsByDir(*dir), TRANSPORT_RAIL, 0));
   295 		if (ts != 0) {
   295 		if (trackbits != TRACK_BIT_NONE) {
   296 			/* If there is any track on the tile, set the bit in the second byte */
   296 			/* If there is any track on the tile, set the bit in the second byte */
   297 			SetBit(res, i + 8);
   297 			SetBit(res, i + 8);
   298 
   298 
   299 			/* If any track reaches our exit direction, set the bit in the lower byte */
   299 			/* If any track reaches our exit direction, set the bit in the lower byte */
   300 			if (ts & DiagdirReachesTracks(*diagdir)) SetBit(res, i);
   300 			if (trackbits & DiagdirReachesTracks(*diagdir)) SetBit(res, i);
   301 		}
   301 		}
   302 	}
   302 	}
   303 
   303 
   304 	return res;
   304 	return res;
   305 }
   305 }