Invalid players removed from global quests

This commit is contained in:
SimonCeder 2022-07-31 14:24:07 +02:00
parent bbf0f5a6f4
commit c760510f5b

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)