Loading

Paste #ptsdqblf6

  1.         /* This station can be used, add it to st1/st2 */
  2.         if (owner == MAX_COMPANIES || owner == INVALID_OWNER || st->owner == OWNER_NONE || st->owner == owner) {
  3.             if (st1 == NULL || st->goods[type].rating >= best_rating1) {
  4.                 st2 = st1; best_rating2 = best_rating1; st1 = st; best_rating1 = st->goods[type].rating;
  5.             } else if (st2 == NULL || st->goods[type].rating >= best_rating2) {
  6.                 st2 = st; best_rating2 = st->goods[type].rating;
  7.             }
  8.         } else {
  9.             if (st1 == NULL) {
  10.                 st1 = st; best_rating1 = st->goods[type].rating;
  11.             } else {
  12.                 if (st->goods[type].rating >= best_rating1) {
  13.                     if (st->owner == st1->owner && (st1->owner == owner || st1->owner == OWNER_NONE) || (st->owner != st1->owner && st1->owner != owner)) {
  14.                         st2 = st1; best_rating2 = best_rating1; st1 = st; best_rating1 = st->goods[type].rating;
  15.                     }
  16.                 } else {
  17.                     if (st2 == NULL) {
  18.                         if (st->owner == st1->owner && (st1->owner == owner || st1->owner == OWNER_NONE) || (st->owner != st1->owner && st1->owner != owner)) {
  19.                             st2 = st; best_rating2 = st->goods[type].rating;
  20.                         }
  21.                     } else {
  22.                         if (st->goods[type].rating >= best_rating2) {
  23.                             if (st->owner == st2->owner && (st2->owner == owner || st2->owner == OWNER_NONE) || (st->owner != st2->owner && st2->owner != owner)) {
  24.                                 st2 = st; best_rating2 = st->goods[type].rating;
  25.                             }
  26.                         }
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.     }

Comments