public void RefreshActiveQuests() { try { var CurrentListOfSNOS = ActiveQuests.Keys.ToList(); List <int> newActiveQuestSNOS = new List <int>(); using (ZetaDia.Memory.AcquireFrame()) { foreach (var aq in ZetaDia.ActInfo.ActiveQuests) { int sno = aq.QuestSNO; newActiveQuestSNOS.Add(sno); //Filter Adventure Mode and Bounty IDs if (sno == ADVENTUREMODE_QUESTID) { continue; } if (BountyQuestStates.ContainsKey(sno)) { continue; } //Ignore entries we already added if (ActiveQuests.ContainsKey(sno)) { ActiveQuests[sno].Refresh(aq); continue; } var newEntry = new QuestInfoCache(aq); ActiveQuests.Add(sno, newEntry); } } var removalQuests = CurrentListOfSNOS.Where(i => !newActiveQuestSNOS.Contains(i)).ToList(); foreach (var sno in removalQuests) { ActiveQuests.Remove(sno); } } catch (Exception ex) { } }
public void RefreshActiveQuests() { try { var CurrentListOfSNOS = ActiveQuests.Keys.ToList(); List<int> newActiveQuestSNOS = new List<int>(); using (ZetaDia.Memory.AcquireFrame()) { foreach (var aq in ZetaDia.ActInfo.ActiveQuests) { int sno = aq.QuestSNO; newActiveQuestSNOS.Add(sno); //Filter Adventure Mode and Bounty IDs if (sno == ADVENTUREMODE_QUESTID) continue; if (BountyQuestStates.ContainsKey(sno)) continue; //Ignore entries we already added if (ActiveQuests.ContainsKey(sno)) { ActiveQuests[sno].Refresh(aq); continue; } var newEntry = new QuestInfoCache(aq); ActiveQuests.Add(sno, newEntry); } } var removalQuests = CurrentListOfSNOS.Where(i => !newActiveQuestSNOS.Contains(i)).ToList(); foreach (var sno in removalQuests) { ActiveQuests.Remove(sno); } } catch (Exception ex) { } }