Replaced a while(true);
This commit is contained in:
parent
2d3fa08d0d
commit
2484bff229
|
@ -67,16 +67,16 @@ public class UniversalItemContainer : IItemContainer
|
||||||
|
|
||||||
public bool AddItemStack(IItemStack itemStack)
|
public bool AddItemStack(IItemStack itemStack)
|
||||||
{
|
{
|
||||||
while (true)
|
ItemSlotNode? itemSlotNode = Match(itemStack);
|
||||||
|
while (itemSlotNode is not null)
|
||||||
{
|
{
|
||||||
var itemSlotNode = Match(itemStack);
|
|
||||||
|
|
||||||
if (itemSlotNode == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (itemSlotNode.AddItemStack(itemStack))
|
if (itemSlotNode.AddItemStack(itemStack))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
itemSlotNode = Match(itemStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetSelectIndex()
|
public int GetSelectIndex()
|
||||||
|
@ -234,7 +234,7 @@ public class UniversalItemContainer : IItemContainer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
itemSlotNode.IsSelect = (_itemSlotNodes.Count ) == _selectIndex;
|
itemSlotNode.IsSelect = (_itemSlotNodes.Count) == _selectIndex;
|
||||||
_itemSlotNodes.Add(itemSlotNode);
|
_itemSlotNodes.Add(itemSlotNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user