src/newgrf_station.cpp
changeset 9038 38f0f10f8cca
parent 9018 403898e0b54e
child 9662 d21460a10105
equal deleted inserted replaced
9037:28b55f76daa5 9038:38f0f10f8cca
   674  */
   674  */
   675 int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec)
   675 int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec)
   676 {
   676 {
   677 	uint i;
   677 	uint i;
   678 
   678 
   679 	if (statspec == NULL) return 0;
   679 	if (statspec == NULL || st == NULL) return 0;
   680 
   680 
   681 	/* Check if this spec has already been allocated */
   681 	/* Check if this spec has already been allocated */
   682 	for (i = 1; i < st->num_specs && i < MAX_SPECLIST; i++) {
   682 	for (i = 1; i < st->num_specs && i < MAX_SPECLIST; i++) {
   683 		if (st->speclist[i].spec == statspec) return i;
   683 		if (st->speclist[i].spec == statspec) return i;
   684 	}
   684 	}