1
0
Fork 0

Fix cItems::AddItemGrid adding empty items

This commit is contained in:
Tiger Wang 2020-09-23 16:02:32 +01:00 committed by Alexander Harkness
parent b5410c718e
commit a2ecbf6a2e
1 changed files with 6 additions and 3 deletions

View File

@ -804,9 +804,12 @@ bool cItems::ContainsType(const cItem & a_Item)
void cItems::AddItemGrid(const cItemGrid & a_ItemGrid)
{
auto numSlots = a_ItemGrid.GetNumSlots();
for (int i = 0; i < numSlots; ++i)
for (int i = 0; i < a_ItemGrid.GetNumSlots(); ++i)
{
Add(a_ItemGrid.GetSlot(i));
const auto & Slot = a_ItemGrid.GetSlot(i);
if (!Slot.IsEmpty())
{
Add(Slot);
}
}
}