equal
deleted
inserted
replaced
155 const Station* st2 = *(const Station**)b; |
155 const Station* st2 = *(const Station**)b; |
156 byte maxr1 = 0; |
156 byte maxr1 = 0; |
157 byte maxr2 = 0; |
157 byte maxr2 = 0; |
158 |
158 |
159 for (CargoID j = 0; j < NUM_CARGO; j++) { |
159 for (CargoID j = 0; j < NUM_CARGO; j++) { |
160 if (st1->goods[j].days_since_pickup != 255) maxr1 = max(maxr1, st1->goods[j].rating); |
160 if (HASBIT(st1->goods[j].acceptance_pickup, GoodsEntry::PICKUP)) maxr1 = max(maxr1, st1->goods[j].rating); |
161 if (st2->goods[j].days_since_pickup != 255) maxr2 = max(maxr2, st2->goods[j].rating); |
161 if (HASBIT(st2->goods[j].acceptance_pickup, GoodsEntry::PICKUP)) maxr2 = max(maxr2, st2->goods[j].rating); |
162 } |
162 } |
163 |
163 |
164 return (_internal_sort_order & 1) ? maxr2 - maxr1 : maxr1 - maxr2; |
164 return (_internal_sort_order & 1) ? maxr2 - maxr1 : maxr1 - maxr2; |
165 } |
165 } |
166 |
166 |
769 |
769 |
770 b = InlineString(b, STR_000C_ACCEPTS); |
770 b = InlineString(b, STR_000C_ACCEPTS); |
771 |
771 |
772 for (CargoID i = 0; i < NUM_CARGO; i++) { |
772 for (CargoID i = 0; i < NUM_CARGO; i++) { |
773 if (b >= endof(_userstring) - 5 - 1) break; |
773 if (b >= endof(_userstring) - 5 - 1) break; |
774 if (st->goods[i].acceptance) { |
774 if (HASBIT(st->goods[i].acceptance_pickup, GoodsEntry::ACCEPTANCE)) { |
775 if (first) { |
775 if (first) { |
776 first = false; |
776 first = false; |
777 } else { |
777 } else { |
778 /* Add a comma if this is not the first item */ |
778 /* Add a comma if this is not the first item */ |
779 *b++ = ','; |
779 *b++ = ','; |
795 for (CargoID i = 0; i < NUM_CARGO; i++) { |
795 for (CargoID i = 0; i < NUM_CARGO; i++) { |
796 const CargoSpec *cs = GetCargo(i); |
796 const CargoSpec *cs = GetCargo(i); |
797 if (!cs->IsValid()) continue; |
797 if (!cs->IsValid()) continue; |
798 |
798 |
799 const GoodsEntry *ge = &st->goods[i]; |
799 const GoodsEntry *ge = &st->goods[i]; |
800 if (ge->days_since_pickup == 255) continue; |
800 if (!HASBIT(ge->acceptance_pickup, GoodsEntry::PICKUP)) continue; |
801 |
801 |
802 SetDParam(0, cs->name); |
802 SetDParam(0, cs->name); |
803 SetDParam(2, ge->rating * 101 >> 8); |
803 SetDParam(2, ge->rating * 101 >> 8); |
804 SetDParam(1, STR_3035_APPALLING + (ge->rating >> 5)); |
804 SetDParam(1, STR_3035_APPALLING + (ge->rating >> 5)); |
805 DrawString(8, y, STR_303D, 0); |
805 DrawString(8, y, STR_303D, 0); |