src/newgrf_station.cpp
branch0.6
changeset 10323 57d8fd25473e
parent 9191 ae14770c829a
child 10328 721fe18a2176
equal deleted inserted replaced
9357:bafe57f3402a 10323:57d8fd25473e
   663  */
   663  */
   664 int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec)
   664 int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec)
   665 {
   665 {
   666 	uint i;
   666 	uint i;
   667 
   667 
   668 	if (statspec == NULL) return 0;
   668 	if (statspec == NULL || st == NULL) return 0;
   669 
   669 
   670 	/* Check if this spec has already been allocated */
   670 	/* Check if this spec has already been allocated */
   671 	for (i = 1; i < st->num_specs && i < MAX_SPECLIST; i++) {
   671 	for (i = 1; i < st->num_specs && i < MAX_SPECLIST; i++) {
   672 		if (st->speclist[i].spec == statspec) return i;
   672 		if (st->speclist[i].spec == statspec) return i;
   673 	}
   673 	}