|
@@ -96,13 +96,13 @@ Town::~Town()
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
DeleteSubsidyWith(ST_TOWN, this->index);
|
|
|
|
|
|
CargoPacket::InvalidateAllFrom(ST_TOWN, this->index);
|
|
|
MarkWholeScreenDirty();
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Invalidating of the "nearest town cache" has to be done
|
|
@@ -457,13 +457,13 @@ static void TileLoop_Town(TileIndex tile
|
|
|
CargoID cargo = GetCargoTranslation(GB(callback, 8, 7), hs->grffile);
|
|
|
if (cargo == CT_INVALID) continue;
|
|
|
|
|
|
uint amt = GB(callback, 0, 8);
|
|
|
if (amt == 0) continue;
|
|
|
|
|
|
uint moved = MoveGoodsToStation(tile, 1, 1, cargo, amt);
|
|
|
uint moved = MoveGoodsToStation(tile, 1, 1, cargo, amt, ST_TOWN, t->index);
|
|
|
|
|
|
const CargoSpec *cs = CargoSpec::Get(cargo);
|
|
|
switch (cs->town_effect) {
|
|
|
case TE_PASSENGERS:
|
|
|
t->new_max_pass += amt;
|
|
|
t->new_act_pass += moved;
|
|
@@ -481,21 +481,21 @@ static void TileLoop_Town(TileIndex tile
|
|
|
} else {
|
|
|
if (GB(r, 0, 8) < hs->population) {
|
|
|
uint amt = GB(r, 0, 8) / 8 + 1;
|
|
|
|
|
|
if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
|
|
|
t->new_max_pass += amt;
|
|
|
t->new_act_pass += MoveGoodsToStation(tile, 1, 1, CT_PASSENGERS, amt);
|
|
|
t->new_act_pass += MoveGoodsToStation(tile, 1, 1, CT_PASSENGERS, amt, ST_TOWN, t->index);
|
|
|
}
|
|
|
|
|
|
if (GB(r, 8, 8) < hs->mail_generation) {
|
|
|
uint amt = GB(r, 8, 8) / 8 + 1;
|
|
|
|
|
|
if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
|
|
|
t->new_max_mail += amt;
|
|
|
t->new_act_mail += MoveGoodsToStation(tile, 1, 1, CT_MAIL, amt);
|
|
|
t->new_act_mail += MoveGoodsToStation(tile, 1, 1, CT_MAIL, amt, ST_TOWN, t->index);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
_current_company = OWNER_TOWN;
|
|
|
|
|
|
if ((hs->building_flags & BUILDING_HAS_1_TILE) &&
|