if (CircularTileSearch(&tile, 40, SearchLumberMillTrees, nullptr)) { // 40x40 tiles to search.
i->produced[0].waiting = ClampTo<uint16_t>(i->produced[0].waiting + 45); // Found a tree, add according value to waiting cargo.
i->produced[0].waiting = ClampTo<uint16_t>(i->produced[0].waiting + ScaleByCargoScale(45, false)); // Found a tree, add according value to waiting cargo.
}
}
/**
* Helper for ProduceIndustryGoods that scales and produces cargos.
* @param i The industry
* @param scale Should we scale production of this cargo directly?
/* If using an industry callback, scale the callback interval by cargo scale percentage. */
if (HasBit(indsp->callback_mask, CBM_IND_PRODUCTION_256_TICKS)) {
if (i->counter % ScaleByInverseCargoScale(Ticks::INDUSTRY_PRODUCE_TICKS, false) == 0) {
IndustryProductionCallback(i, 1);
ProduceIndustryGoodsHelper(i, false);
}
}
/*
* All other production and special effects happen every 256 ticks, and cargo production is just scaled by the cargo scale percentage.
* This keeps a slow trickle of production to avoid confusion at low scale factors when the industry seems to be doing nothing for a long period of time.
*/
if ((i->counter % Ticks::INDUSTRY_PRODUCE_TICKS) == 0) {
if (HasBit(indsp->callback_mask, CBM_IND_PRODUCTION_256_TICKS)) IndustryProductionCallback(i, 1);
/* Handle non-callback cargo production. */
if (!HasBit(indsp->callback_mask, CBM_IND_PRODUCTION_256_TICKS)) ProduceIndustryGoodsHelper(i, true);
STR_CONFIG_SETTING_MINUTES_PER_YEAR_FROZEN :0 (calendar time frozen)
STR_CONFIG_SETTING_TOWN_CARGO_SCALE :Scale town cargo production: {STRING2}
STR_CONFIG_SETTING_TOWN_CARGO_SCALE_HELPTEXT :Scale the cargo production of towns by this percentage.
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE :Scale industry cargo production: {STRING2}
STR_CONFIG_SETTING_INDUSTRY_CARGO_SCALE_HELPTEXT :Scale the cargo production of industries by this percentage.
STR_CONFIG_SETTING_CARGO_SCALE_VALUE :{NUM}%
STR_CONFIG_SETTING_AUTORENEW_VEHICLE :Autorenew vehicle when it gets old: {STRING2}
STR_CONFIG_SETTING_AUTORENEW_VEHICLE_HELPTEXT :When enabled, a vehicle nearing its end of life gets automatically replaced when the renew conditions are fulfilled
src/object_cmd.cpp
➞
Show inline comments
@@ -688,7 +688,13 @@ static void TileLoop_Object(TileIndex ti
/* Top town buildings generate 250, so the top HQ type makes 256. */