mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 15:01:09 -04:00
Fixed bug where if the AI completed all the policies and needed to pick another one, the game would crash
This commit is contained in:
parent
2799205884
commit
dae20d09dc
@ -199,6 +199,10 @@ class NextTurnAutomation{
|
|||||||
.flatMap { it.policies.union(listOf(it)) }
|
.flatMap { it.policies.union(listOf(it)) }
|
||||||
.filter { civInfo.policies.isAdoptable(it) }
|
.filter { civInfo.policies.isAdoptable(it) }
|
||||||
|
|
||||||
|
// This can happen if the player is crazy enough to have the game continue forever and he disabled cultural victory
|
||||||
|
if(adoptablePolicies.isEmpty()) return
|
||||||
|
|
||||||
|
|
||||||
val preferredVictoryType = civInfo.victoryType()
|
val preferredVictoryType = civInfo.victoryType()
|
||||||
val policyBranchPriority =
|
val policyBranchPriority =
|
||||||
when(preferredVictoryType) {
|
when(preferredVictoryType) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user