|
@@ -322,49 +322,49 @@ static void AddAcceptedCargo_Unmovable(T
|
|
|
* commercial building generates unusually high amount of mail
|
|
|
* correspondence per physical visitor. */
|
|
|
acceptance[CT_MAIL] += max(1U, level / 2);
|
|
|
SetBit(*always_accepted, CT_MAIL);
|
|
|
}
|
|
|
|
|
|
|
|
|
static void GetTileDesc_Unmovable(TileIndex tile, TileDesc *td)
|
|
|
{
|
|
|
td->str = GetUnmovableSpec(GetUnmovableType(tile))->name;
|
|
|
td->owner[0] = GetTileOwner(tile);
|
|
|
}
|
|
|
|
|
|
static void TileLoop_Unmovable(TileIndex tile)
|
|
|
{
|
|
|
if (!IsCompanyHQ(tile)) return;
|
|
|
|
|
|
/* HQ accepts passenger and mail; but we have to divide the values
|
|
|
* between 4 tiles it occupies! */
|
|
|
|
|
|
/* HQ level (depends on company performance) in the range 1..5. */
|
|
|
uint level = GetCompanyHQSize(tile) + 1;
|
|
|
assert(level < 6);
|
|
|
|
|
|
StationFinder stations(tile, 2, 2);
|
|
|
StationFinder stations(TileArea(tile, 2, 2));
|
|
|
|
|
|
uint r = Random();
|
|
|
/* Top town buildings generate 250, so the top HQ type makes 256. */
|
|
|
if (GB(r, 0, 8) < (256 / 4 / (6 - level))) {
|
|
|
uint amt = GB(r, 0, 8) / 8 / 4 + 1;
|
|
|
if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
|
|
|
MoveGoodsToStation(CT_PASSENGERS, amt, ST_HEADQUARTERS, GetTileOwner(tile), stations.GetStations());
|
|
|
}
|
|
|
|
|
|
/* Top town building generates 90, HQ can make up to 196. The
|
|
|
* proportion passengers:mail is about the same as in the acceptance
|
|
|
* equations. */
|
|
|
if (GB(r, 8, 8) < (196 / 4 / (6 - level))) {
|
|
|
uint amt = GB(r, 8, 8) / 8 / 4 + 1;
|
|
|
if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
|
|
|
MoveGoodsToStation(CT_MAIL, amt, ST_HEADQUARTERS, GetTileOwner(tile), stations.GetStations());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
static TrackStatus GetTileTrackStatus_Unmovable(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
|
|
|
{
|
|
|
return 0;
|
|
|
}
|