void LoadObtainedProgressionItemsFromSave(Level level) { var itemsInMap = this.Select(l => l.ItemInfo.Identifier) .Distinct().ToHashSet(); var updateTracker = false; foreach (var progressionItem in UnlockingMap.AllProgressionItems) { if (level.GameSave.HasItem(progressionItem) && !itemsInMap.Contains(progressionItem)) { var item = new SingleItemInfo(UnlockingMap, progressionItem); item.OnPickup(level); Add(new ExternalItemLocation(item)); updateTracker = true; } } if (updateTracker) { ItemTrackerUplink.UpdateState(ItemTrackerState.FromItemLocationMap(this)); } }
void ReceiveItem(NetworkItem networkItem, Level level) { if (TryGetLocation(networkItem, out var location) && networkItem.Player == slot) { //ignore message if its from my slot and a location i already picked up if (location.IsPickedUp && personalLocationItemKeys.Contains(location.Key)) { return; } } else { location = new ExternalItemLocation(); Add(location); } if (!TryGetItemIdentifier(networkItem, out var itemIdentifier)) { return; } // itemInfoProvider's cache is out of date here when it comes to pyramid unlocks var item = new SingleItemInfo(UnlockingMap, itemIdentifier); location.SetItem(item); location.IsPickedUp = true; item.OnPickup(level); level.GameSave.AddItem(level, itemIdentifier); if (itemIdentifier.LootType == LootType.ConstRelic) { level.AsDynamic().UnlockRelic(itemIdentifier.Relic); } if (!firstPass || item.IsProgression) { level.ShowItemAwardPopup(itemIdentifier); } if (item.IsProgression) { ItemTrackerUplink.UpdateState(ItemTrackerState.FromItemLocationMap(this)); } }