diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-11-02 16:30:34 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-11-02 16:30:34 +1100 |
commit | 86f41b8450431405c80270bb5fa78c096aa424fc (patch) | |
tree | c639b62cd7749c10afc9fbf076f2d9f9a8ecbc9c /source/frontend/StarInventory.cpp | |
parent | f5c63fa189d65be1e16ba74719c867f44b7e0d52 (diff) |
Fix crash right clicking empty item slots with no swap item
Diffstat (limited to 'source/frontend/StarInventory.cpp')
-rw-r--r-- | source/frontend/StarInventory.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/frontend/StarInventory.cpp b/source/frontend/StarInventory.cpp index bf9d0fb..b73b33e 100644 --- a/source/frontend/StarInventory.cpp +++ b/source/frontend/StarInventory.cpp @@ -76,8 +76,7 @@ InventoryPane::InventoryPane(MainInterface* parent, PlayerPtr player, ContainerI inventory->setItem(slot, augmented); } } - else { - auto swapSlot = inventory->swapSlotItem(); + else if (auto swapSlot = inventory->swapSlotItem()) { if (auto es = slot.ptr<EquipmentSlot>()) { if (inventory->itemAllowedAsEquipment(swapSlot, *es)) inventory->setItem(slot, swapSlot->take(1)); |