mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 05:14:32 -04:00
Do not trigger the Time Victory if it is not enabled (#7197)
* Whitespaces * Use the proper list of victory types * Clean up if the victory type was removed
This commit is contained in:
parent
1facd97782
commit
35a4f079b1
@ -55,7 +55,7 @@ class VictoryManager {
|
||||
|
||||
fun getVictoryTypeAchieved(): String? {
|
||||
if (!civInfo.isMajorCiv()) return null
|
||||
for (victoryName in civInfo.gameInfo.ruleSet.victories.keys.filter { it != Constants.neutralVictoryType}) {
|
||||
for (victoryName in civInfo.gameInfo.gameParameters.victoryTypes.filter { it != Constants.neutralVictoryType}) {
|
||||
if (getNextMilestone(victoryName) == null)
|
||||
return victoryName
|
||||
}
|
||||
|
@ -57,6 +57,9 @@ class NewGameScreen(
|
||||
updateRuleset() // must come before playerPickerTable so mod nations from fromSettings
|
||||
// Has to be initialized before the mapOptionsTable, since the mapOptionsTable refers to it on init
|
||||
|
||||
// remove the victory types which are not in the rule set (e.g. were in the recently disabled mod)
|
||||
gameSetupInfo.gameParameters.victoryTypes.removeAll { it !in ruleset.victories.keys }
|
||||
|
||||
if (gameSetupInfo.gameParameters.victoryTypes.isEmpty())
|
||||
gameSetupInfo.gameParameters.victoryTypes.addAll(ruleset.victories.keys)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user