Browse Source

Fix OOB access when accessing stash

pull/5814/head
staphen 3 years ago committed by Anders Jenbo
parent
commit
58b48e17ea
  1. 7
      Source/qol/stash.cpp

7
Source/qol/stash.cpp

@ -357,10 +357,11 @@ void DrawStash(const Surface &out)
for (auto slot : StashGridRange) {
StashStruct::StashCell itemId = Stash.GetItemIdAtPosition(slot);
Item &item = Stash.stashList[itemId];
if (Stash.IsItemAtPosition(slot)) {
InvDrawSlotBack(out, GetStashSlotCoord(slot) + offset, InventorySlotSizeInPixels, item._iMagical);
if (itemId == StashStruct::EmptyCell) {
continue; // No item in the given slot
}
Item &item = Stash.stashList[itemId];
InvDrawSlotBack(out, GetStashSlotCoord(slot) + offset, InventorySlotSizeInPixels, item._iMagical);
}
for (auto slot : StashGridRange) {

Loading…
Cancel
Save