summaryrefslogtreecommitdiff
path: root/src/net/eathena/inventoryhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena/inventoryhandler.cpp')
-rw-r--r--src/net/eathena/inventoryhandler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 48fdb67b8..61d081434 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -833,9 +833,13 @@ void InventoryHandler::processPlayerStorageAdd(Net::MessageIn &msg)
void InventoryHandler::processPlayerUseCard(Net::MessageIn &msg)
{
+ const Inventory *const inv = PlayerInfo::getInventory();
+ const int index = inventoryHandler->getItemIndex();
+ const Item *item1 = nullptr;
+ if (inv)
+ item1 = inv->getItem(index);
SellDialog *const dialog = CREATEWIDGETR(InsertCardDialog,
- inventoryHandler->getItemIndex());
- Inventory *const inv = PlayerInfo::getInventory();
+ index, item1);
const int count = (msg.readInt16("len") - 4) / 2;
for (int f = 0; f < count; f ++)