mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Resolved #1229 - AI doesn't choose to construct workers if the Civ has idle automated workers
This commit is contained in:
parent
7d1fd6e177
commit
6fb3ba0f13
@ -112,6 +112,8 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun addWorkerChoice() {
|
private fun addWorkerChoice() {
|
||||||
|
if(civInfo.getIdleUnits().any { it.name==Constants.worker && it.action== Constants.unitActionAutomation})
|
||||||
|
return // If we have automated workers who have no work to do then it's silly to construct new workers.
|
||||||
val citiesCountedTowardsWorkers = min(5, cities) // above 5 cities, extra cities won't make us want more workers
|
val citiesCountedTowardsWorkers = min(5, cities) // above 5 cities, extra cities won't make us want more workers
|
||||||
if (workers < citiesCountedTowardsWorkers * 0.6f && civUnits.none { it.name==Constants.worker && it.isIdle() }) {
|
if (workers < citiesCountedTowardsWorkers * 0.6f && civUnits.none { it.name==Constants.worker && it.isIdle() }) {
|
||||||
var modifier = citiesCountedTowardsWorkers / (workers + 0.1f)
|
var modifier = citiesCountedTowardsWorkers / (workers + 0.1f)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user