From c53f4620bdaa1ae3fe0a15aa237ea88d28da0954 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 6 May 2012 03:42:14 +0300 Subject: Fix possible crash in popup menu. --- src/gui/popupmenu.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index ea324d675..e2009ee28 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -851,20 +851,6 @@ void PopupMenu::handleLink(const std::string &link, else if (link == "look") { } - else if (link == "use" && mItem) - { - if (mItem->isEquipment()) - { - if (mItem->isEquipped()) - Net::getInventoryHandler()->unequipItem(mItem); - else - Net::getInventoryHandler()->equipItem(mItem); - } - else - { - Net::getInventoryHandler()->useItem(mItem); - } - } else if (link == "use" && mItemId) { if (mItemId < SPELL_MIN_ID) @@ -1623,6 +1609,8 @@ void PopupMenu::showPopup(Window *parent, int x, int y, Item *item, return; mItem = item; + mItemId = item->getId(); + mItemColor = item->getColor(); mWindow = parent; mX = x; mY = y; @@ -1818,6 +1806,8 @@ void PopupMenu::showItemPopup(int x, int y, Item *item) void PopupMenu::showDropPopup(int x, int y, Item *item) { mItem = item; + mItemId = item->getId(); + mItemColor = item->getColor(); mX = x; mY = y; mNick = ""; -- cgit v1.2.3-60-g2f50