Resolves second part of #7708 - don't re-raise tech popups for previously researched techs (#7757)

This commit is contained in:
Yair Morgenstern
2022-09-08 16:17:17 +03:00
committed by GitHub
parent b11c01bfdc
commit 30c426959b

View File

@ -238,7 +238,7 @@ class TechManager : IsPartOfGameInfoSerialization {
}
fun addTechnology(techName: String) {
techsResearched.add(techName)
val isNewTech = techsResearched.add(techName)
// this is to avoid concurrent modification problems
val newTech = getRuleset().technologies[techName]!!
@ -257,7 +257,8 @@ class TechManager : IsPartOfGameInfoSerialization {
}
civInfo.addNotification("Research of [$techName] has completed!", TechAction(techName), NotificationIcon.Science, techName)
civInfo.popupAlerts.add(PopupAlert(AlertType.TechResearched, techName))
if (isNewTech)
civInfo.popupAlerts.add(PopupAlert(AlertType.TechResearched, techName))
if (civInfo.playerType == PlayerType.Human) {
for (revealedResource in getRuleset().tileResources.values.filter { techName == it.revealedBy }) {