mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 14:02:48 +07:00
Fixed crash when a worker tries to build a cached improvement that it can't build (#10854)
* Worker won't try to build the cached improvement that it can't build * Accounted for the repair case as well
This commit is contained in:
parent
1a0bdff019
commit
fa9d7e1ca7
@ -564,7 +564,9 @@ class WorkerAutomation(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A better tile than this unit can build might have been stored in the cache
|
||||
if (!rank.repairImprovment!! && (rank.bestImprovement == null ||
|
||||
!unit.canBuildImprovement(rank.bestImprovement!!, tile))) return -100f
|
||||
return rank.improvementPriority!!
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user