mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 07:48:31 +07:00
Resolve #7705 - correct filtering of civs that need to have majority religion for world religion to activate
This was very poorly implemented
This commit is contained in:
@ -103,7 +103,9 @@ class Milestone(val uniqueDescription: String, private val parentVictory: Victor
|
|||||||
MilestoneType.WorldReligion -> {
|
MilestoneType.WorldReligion -> {
|
||||||
civInfo.gameInfo.isReligionEnabled()
|
civInfo.gameInfo.isReligionEnabled()
|
||||||
&& civInfo.religionManager.religion != null
|
&& civInfo.religionManager.religion != null
|
||||||
&& civInfo.gameInfo.civilizations.all {
|
&& civInfo.gameInfo.civilizations
|
||||||
|
.filter { it.isMajorCiv() && it.isAlive() }
|
||||||
|
.all {
|
||||||
it.religionManager.isMajorityReligionForCiv(civInfo.religionManager.religion!!)
|
it.religionManager.isMajorityReligionForCiv(civInfo.religionManager.religion!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,13 +156,14 @@ class Milestone(val uniqueDescription: String, private val parentVictory: Victor
|
|||||||
"{$uniqueDescription} ($amountDone/$amountToDo)"
|
"{$uniqueDescription} ($amountDone/$amountToDo)"
|
||||||
}
|
}
|
||||||
MilestoneType.WorldReligion -> {
|
MilestoneType.WorldReligion -> {
|
||||||
val amountToDo = civInfo.gameInfo.civilizations.count { it.isMajorCiv() } - 1 // Don't count yourself
|
val amountToDo = civInfo.gameInfo.civilizations.count { it.isMajorCiv() && it.isAlive() } - 1 // Don't count yourself
|
||||||
val amountDone =
|
val amountDone =
|
||||||
when {
|
when {
|
||||||
completed -> amountToDo
|
completed -> amountToDo
|
||||||
civInfo.religionManager.religion == null -> 0
|
civInfo.religionManager.religion == null -> 0
|
||||||
civInfo.religionManager.religion!!.isPantheon() -> 1
|
civInfo.religionManager.religion!!.isPantheon() -> 1
|
||||||
else -> civInfo.gameInfo.civilizations.count {
|
else -> civInfo.gameInfo.civilizations.count {
|
||||||
|
it.isMajorCiv() && it.isAlive() &&
|
||||||
it.religionManager.isMajorityReligionForCiv(civInfo.religionManager.religion!!)
|
it.religionManager.isMajorityReligionForCiv(civInfo.religionManager.religion!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user