diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index 8684eac43e..dfeec1cc78 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -63,7 +63,7 @@ object Automation { val surplusFood = cityStats[Stat.Food] // If current Production converts Food into Production, then calculate increased Production Yield - if(cityStatsObj.canConvertFoodToProduction(surplusFood, city.cityConstructions.getCurrentConstruction())) { + if (cityStatsObj.canConvertFoodToProduction(surplusFood, city.cityConstructions.getCurrentConstruction())) { // calculate delta increase of food->prod. This isn't linear yieldStats.production += cityStatsObj.getProductionFromExcessiveFood(surplusFood+yieldStats.food) - cityStatsObj.getProductionFromExcessiveFood(surplusFood) yieldStats.food = 0f // all food goes to 0 diff --git a/core/src/com/unciv/logic/city/CityStats.kt b/core/src/com/unciv/logic/city/CityStats.kt index c45b82f5ab..8f27697f89 100644 --- a/core/src/com/unciv/logic/city/CityStats.kt +++ b/core/src/com/unciv/logic/city/CityStats.kt @@ -606,8 +606,13 @@ class CityStats(val city: City) { && currentConstruction.hasUnique(UniqueType.ConvertFoodToProductionWhenConstructed)) } - // calculate the conversion of the excessive food to the production - // See for details: https://civilization.fandom.com/wiki/Settler_(Civ5) + /** + * Calculate the conversion of the excessive food to production when + * [UniqueType.ConvertFoodToProductionWhenConstructed] is at front of the build queue + * @param food is amount of excess Food generates this turn + * See for details: https://civilization.fandom.com/wiki/Settler_(Civ5) + * @see calcFoodEaten as well for Food consumed this turn + */ fun getProductionFromExcessiveFood(food : Float): Float { return if (food >= 4.0f ) 2.0f + (food / 4.0f).toInt() else if (food >= 2.0f ) 2.0f