mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-23 14:19:15 +07:00
Actually I think I had it right the first time - avoid building if all carriable units can already be carried now, NOT if carrier will have empty slots
This commit is contained in:
@ -159,9 +159,8 @@ object Automation {
|
|||||||
val totalCarriableUnits =
|
val totalCarriableUnits =
|
||||||
civInfo.units.getCivUnits().count { it.matchesFilter(carryFilter) }
|
civInfo.units.getCivUnits().count { it.matchesFilter(carryFilter) }
|
||||||
val totalCarryingSlots = civInfo.units.getCivUnits().sumOf { getCarryAmount(it) }
|
val totalCarryingSlots = civInfo.units.getCivUnits().sumOf { getCarryAmount(it) }
|
||||||
val currentUnitCarryingSlots = carryUnique.params[0].toInt()
|
|
||||||
|
|
||||||
return totalCarriableUnits < totalCarryingSlots + currentUnitCarryingSlots
|
return totalCarriableUnits < totalCarryingSlots
|
||||||
}
|
}
|
||||||
|
|
||||||
fun chooseMilitaryUnit(city: City, availableUnits: Sequence<BaseUnit>): String? {
|
fun chooseMilitaryUnit(city: City, availableUnits: Sequence<BaseUnit>): String? {
|
||||||
|
Reference in New Issue
Block a user