Fix crash right clicking empty item slots with no swap item

This commit is contained in:
Kae 2023-11-02 16:30:34 +11:00
parent f5c63fa189
commit 86f41b8450

View File

@ -76,8 +76,7 @@ InventoryPane::InventoryPane(MainInterface* parent, PlayerPtr player, ContainerI
inventory->setItem(slot, augmented); inventory->setItem(slot, augmented);
} }
} }
else { else if (auto swapSlot = inventory->swapSlotItem()) {
auto swapSlot = inventory->swapSlotItem();
if (auto es = slot.ptr<EquipmentSlot>()) { if (auto es = slot.ptr<EquipmentSlot>()) {
if (inventory->itemAllowedAsEquipment(swapSlot, *es)) if (inventory->itemAllowedAsEquipment(swapSlot, *es))
inventory->setItem(slot, swapSlot->take(1)); inventory->setItem(slot, swapSlot->take(1));