mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 21:03:15 -04:00
chore: Early exit moveToNewEra
This commit is contained in:
parent
9fca320574
commit
ced36b8e8a
@ -417,7 +417,8 @@ class TechManager : IsPartOfGameInfoSerialization {
|
||||
val previousEra = civInfo.getEra()
|
||||
updateEra()
|
||||
val currentEra = civInfo.getEra()
|
||||
if (previousEra != currentEra) {
|
||||
if (previousEra == currentEra) return
|
||||
|
||||
if (showNotification) {
|
||||
if (!civInfo.isSpectator())
|
||||
civInfo.addNotification(
|
||||
@ -433,6 +434,7 @@ class TechManager : IsPartOfGameInfoSerialization {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for (policyBranch in getRuleset().policyBranches.values.filter {
|
||||
it.era == currentEra.name && civInfo.policies.isAdoptable(it)
|
||||
}) {
|
||||
@ -450,7 +452,6 @@ class TechManager : IsPartOfGameInfoSerialization {
|
||||
.filter { it.eraNumber > previousEra.eraNumber && it.eraNumber <= currentEra.eraNumber }
|
||||
.sortedBy { it.eraNumber }
|
||||
|
||||
|
||||
for (era in erasPassed)
|
||||
for (unique in era.uniqueObjects)
|
||||
if (!unique.hasTriggerConditional() && unique.conditionalsApply(civInfo.state))
|
||||
@ -477,7 +478,6 @@ class TechManager : IsPartOfGameInfoSerialization {
|
||||
civInfo,
|
||||
triggerNotificationText = "due to entering the [${currentEra.name}]")
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateEra() {
|
||||
val ruleset = civInfo.gameInfo.ruleset
|
||||
|
Loading…
x
Reference in New Issue
Block a user