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:
Yair Morgenstern 2019-07-29 17:04:03 +03:00
parent 2799205884
commit dae20d09dc

View File

@ -199,6 +199,10 @@ class NextTurnAutomation{
.flatMap { it.policies.union(listOf(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 policyBranchPriority =
when(preferredVictoryType) {