File diff r14156:7136b6af34ec → r14157:8722b3bbfc4d
src/unmovable_cmd.cpp
Show inline comments
 
@@ -334,25 +334,25 @@ static void GetTileDesc_Unmovable(TileIn
 

	
 
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. */