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