29 #include "table/strings.h"
42 assert(!this->IsAwarded());
44 this->awarded = company;
49 GetString(company_name, STR_COMPANY_NAME,
lastof(company_name));
51 char *cn =
stredup(company_name);
94 default: NOT_REACHED();
107 default: NOT_REACHED();
128 default: NOT_REACHED();
142 FOR_ALL_SUBSIDIES(s) {
158 FOR_ALL_SUBSIDIES(s) {
183 FOR_ALL_SUBSIDIES(s) {
340 ClrBit(town_cargo_produced, CT_PASSENGERS);
343 if (town_cargo_produced == 0)
return false;
348 FOR_EACH_SET_CARGO_ID(cid, town_cargo_produced) {
349 if (cargo_number == 0)
break;
379 if (src_ind == NULL)
return false;
431 dst = dst_town->
index;
440 if (dst_ind == NULL ||
447 dst = dst_ind->
index;
451 default: NOT_REACHED();
455 if (src_type == dst_type && src == dst)
return false;
471 bool modified =
false;
474 FOR_ALL_SUBSIDIES(s) {
505 bool passenger_subsidy =
false;
506 bool town_subsidy =
false;
507 bool industry_subsidy =
false;
517 }
while (!passenger_subsidy && n--);
518 }
else if (random_chance == 2) {
524 }
while (!town_subsidy && n--);
525 }
else if (random_chance == 3) {
531 }
while (!industry_subsidy && n--);
534 modified |= passenger_subsidy || town_subsidy || industry_subsidy;
557 if (!(
Town::Get(src)->cache.part_of_subsidy & POS_SRC))
return false;
559 default:
return false;
565 if (!st->
rect.IsEmpty()) {
567 FOR_ALL_SUBSIDIES(s) {
575 for (
int y = rect.top; y <= rect.bottom; y++) {
576 for (
int x = rect.left; x <= rect.right; x++) {
579 const Town *t = Town::GetByTile(tile);
587 bool subsidised =
false;
592 FOR_ALL_SUBSIDIES(s) {
597 if (s->
dst == (*ip)->index) {
598 assert((*ip)->part_of_subsidy &
POS_DST);
605 for (
const Town *
const *tp = towns_near.
Begin(); tp != towns_near.
End(); tp++) {
606 if (s->
dst == (*tp)->index) {
607 assert((*tp)->cache.part_of_subsidy &
POS_DST);