equal
deleted
inserted
replaced
513 ctype = GC_PURCHASE; |
513 ctype = GC_PURCHASE; |
514 } else { |
514 } else { |
515 /* Pick the first cargo that we have waiting */ |
515 /* Pick the first cargo that we have waiting */ |
516 for (CargoID cargo = 0; cargo < NUM_CARGO; cargo++) { |
516 for (CargoID cargo = 0; cargo < NUM_CARGO; cargo++) { |
517 const CargoSpec *cs = GetCargo(cargo); |
517 const CargoSpec *cs = GetCargo(cargo); |
518 if (cs->bitnum != 0xFF && object->u.station.statspec->spritegroup[cs->bitnum] != NULL && |
518 if (cs->IsValid() && object->u.station.statspec->spritegroup[cs->bitnum] != NULL && |
519 GB(object->u.station.st->goods[cargo].waiting_acceptance, 0, 12) != 0) { |
519 GB(object->u.station.st->goods[cargo].waiting_acceptance, 0, 12) != 0) { |
520 ctype = cs->bitnum; |
520 ctype = cs->bitnum; |
521 break; |
521 break; |
522 } |
522 } |
523 } |
523 } |