summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Item.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Item.cpp b/src/Item.cpp
index f1177c84a..ca4210c75 100644
--- a/src/Item.cpp
+++ b/src/Item.cpp
@@ -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);
+ }
}
}