Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarInventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/frontend/StarInventory.cpp')
-rw-r--r--source/frontend/StarInventory.cpp3
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));