| 619 | } |
| 620 | |
| 621 | static void AddAcceptedCargo_Object(TileIndex tile, CargoArray &acceptance, CargoTypes &always_accepted) |
| 622 | { |
| 623 | if (!IsObjectType(tile, OBJECT_HQ)) return; |
| 624 | |
| 625 | /* HQ accepts passenger and mail; but we have to divide the values |
| 626 | * between 4 tiles it occupies! */ |
| 627 | |
| 628 | /* HQ level (depends on company performance) in the range 1..5. */ |
| 629 | uint level = GetCompanyHQSize(tile) + 1; |
| 630 | |
| 631 | /* Top town building generates 10, so to make HQ interesting, the top |
| 632 | * type makes 20. */ |
| 633 | CargoType pass = GetCargoTypeByLabel(CT_PASSENGERS); |
| 634 | if (IsValidCargoType(pass)) { |
| 635 | acceptance[pass] += std::max(1U, level); |
| 636 | SetBit(always_accepted, pass); |
| 637 | } |
| 638 | |
| 639 | /* Top town building generates 4, HQ can make up to 8. The |
| 640 | * proportion passengers:mail is different because such a huge |
| 641 | * commercial building generates unusually high amount of mail |
| 642 | * correspondence per physical visitor. */ |
| 643 | CargoType mail = GetCargoTypeByLabel(CT_MAIL); |
| 644 | if (IsValidCargoType(mail)) { |
| 645 | acceptance[mail] += std::max(1U, level / 2); |
| 646 | SetBit(always_accepted, mail); |
| 647 | } |
| 648 | } |
| 649 | |
| 650 | static void AddProducedCargo_Object(TileIndex tile, CargoArray &produced) |
| 651 | { |
nothing calls this directly
no test coverage detected