Merge pull request #7566 from SimonCeder/globalquestscheck

Invalid players removed from global quests
This commit is contained in:
SimonCeder 2022-07-31 17:59:30 +02:00 committed by GitHub
commit 605956c4d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,6 +234,9 @@ class QuestManager : IsPartOfGameInfoSerialization {
}
private fun handleGlobalQuests() {
// Remove any participants that are no longer valid because of being dead or at war with the CS
assignedQuests.removeAll { it.isGlobal() &&
!canAssignAQuestTo(civInfo.gameInfo.getCivilization(it.assignee)) }
val globalQuestsExpired = assignedQuests.filter { it.isGlobal() && it.isExpired() }.map { it.questName }.distinct()
for (globalQuestName in globalQuestsExpired)
handleGlobalQuest(globalQuestName)