equal
deleted
inserted
replaced
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 } |