Skip to content

Commit

Permalink
Fix AddDiscoveredLoot
Browse files Browse the repository at this point in the history
  • Loading branch information
Triky313 committed Jul 5, 2021
1 parent 47b0ff2 commit bfa8fe8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,11 @@ private void RemoveLeftOverDungeonNotificationFragments(ObservableCollection<Dun

public void UpdateDungeonDataUi(DungeonObject dungeon)
{
if (dungeon == null)
{
return;
}

Application.Current.Dispatcher.Invoke(delegate
{
var uiDungeon = _mainWindowViewModel?.TrackingDungeons?.FirstOrDefault(x =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public LootController(TrackingController trackingController, MainWindow mainWind

public void AddDiscoveredLoot(DiscoveredLoot loot)
{
if (_discoveredLoot.Exists(x => x.ObjectId == loot.ObjectId))
{
return;
}

_discoveredLoot.Add(loot);
}

Expand All @@ -42,7 +47,7 @@ public void RemoveDiscoveredLoot(long? objectId)

public void AddPutLoot(long? objectId, Guid? interactGuid)
{
if (_trackingController.EntityController.GetLocalEntity()?.Value.InteractGuid != interactGuid)
if (_trackingController.EntityController.GetLocalEntity()?.Value?.InteractGuid != interactGuid)
{
return;
}
Expand All @@ -65,12 +70,12 @@ private void LootMerge()
{
foreach (var lootedObject in _putLoot)
{
if (!_discoveredLoot.Exists(x => x.ItemId == lootedObject.Key))
if (!_discoveredLoot.Exists(x => x.ObjectId == lootedObject.Key))
{
continue;
}

var discoveredLoot = _discoveredLoot.FirstOrDefault(x => x.ItemId == lootedObject.Key);
var discoveredLoot = _discoveredLoot.FirstOrDefault(x => x.ObjectId == lootedObject.Key);
if (discoveredLoot != null)
{

Expand Down

0 comments on commit bfa8fe8

Please sign in to comment.