diff options
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index f701ab6af..fd998180a 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -1019,12 +1019,28 @@ void ItemContainer::mouseReleased(MouseEvent &event) } else if (src == DragDropSource::Mail) { - inventory = PlayerInfo::getInventory(); - if (inventory != nullptr) + if (settings.enableNewMailSystem) { + if (mailEditWindow == nullptr) + return; + inventory = mailEditWindow->getInventory(); + if (inventory == nullptr) + return; const Item *const item = inventory->getItem(dragDrop.getTag()); - if (item != nullptr) - mInventory->removeItemAt(dragDrop.getTag()); + if (item == nullptr) + return; + mail2Handler->removeItem(item->getTag(), + item->getQuantity()); + } + else + { + inventory = PlayerInfo::getInventory(); + if (inventory == nullptr) + return; + const Item *const item = inventory->getItem(dragDrop.getTag()); + if (item == nullptr) + return; + mInventory->removeItemAt(dragDrop.getTag()); } return; } |