Skip to content

Commit

Permalink
refactor: added suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsol6 authored and ktos committed Dec 16, 2024
1 parent fac2947 commit 70e4b02
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Server/Components/Popups/EquipmentPopup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,23 @@

if (Equipment.Count < slots)
{
for (int i = 0; i < Equipment.Count; i++)
if (item.Type.Equals(ItemType.Ring))
{
if (Equipment[i].Type.Equals(item.Type))
item.IsEquipped = true;
ItemsRepository.UpdateItemAsync(item);
Equipment.Add(item);
}

foreach (var equipped in Equipment)
{
if (equipped.Type.Equals(item.Type))
{
if (item.Type.Equals(ItemType.Ring))
{
item.IsEquipped = true;
ItemsRepository.UpdateItemAsync(item);
Equipment.Add(item);
}
return;
}
}
item.IsEquipped = true;
ItemsRepository.UpdateItemAsync(item);
Equipment.Add(item);
item.IsEquipped = true;
ItemsRepository.UpdateItemAsync(item);
Equipment.Add(item);
}
}

Expand Down

0 comments on commit 70e4b02

Please sign in to comment.