newgrf_station.c
changeset 3766 fc2dea6ef369
parent 3765 a4ddbff73f9f
child 3775 0fb5118536c3
equal deleted inserted replaced
3765:a4ddbff73f9f 3766:fc2dea6ef369
   638 	}
   638 	}
   639 
   639 
   640 	return true;
   640 	return true;
   641 }
   641 }
   642 
   642 
       
   643 /* Check if a rail station tile is traversable.
       
   644  * XXX This could be cached (during build) in the map array to save on all the dereferencing */
       
   645 bool IsStationTileBlocked(TileIndex tile)
       
   646 {
       
   647 	const Station *st;
       
   648 	const StationSpec *statspec;
       
   649 	uint specindex;
       
   650 
       
   651 	if (!IsCustomStationSpecIndex(tile)) return false;
       
   652 
       
   653 	st = GetStationByTile(tile);
       
   654 	specindex = GetCustomStationSpecIndex(tile);
       
   655 	if (specindex >= st->num_specs) return false;
       
   656 
       
   657 	statspec = st->speclist[specindex].spec;
       
   658 	if (statspec == NULL) return false;
       
   659 
       
   660 	return HASBIT(statspec->blocked, GetStationGfx(tile));
       
   661 }