From 65b614a0d142e229206fbde22a25f4a3b20b1dbc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Jun 2013 22:14:54 +0300 Subject: In drag and drop use ints and images but not pointer to item. --- src/gui/outfitwindow.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/gui/outfitwindow.cpp') diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index b00ab69b9..45ee8465f 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -443,11 +443,10 @@ void OutfitWindow::mousePressed(gcn::MouseEvent &event) } else { - Item *const selected = dragDrop.getSelected(); - if (selected) + if (dragDrop.isSelected()) { - mItems[mCurrentOutfit][index] = selected->getId(); - mItemColors[mCurrentOutfit][index] = selected->getColor(); + mItems[mCurrentOutfit][index] = dragDrop.getSelected(); + mItemColors[mCurrentOutfit][index] = dragDrop.getSelectedColor(); dragDrop.deselect(); } } @@ -475,14 +474,10 @@ void OutfitWindow::mouseReleased(gcn::MouseEvent &event) event.consume(); if (!dragDrop.isEmpty()) { - Item *const item = dragDrop.getItem(); - if (item) - { - mItems[mCurrentOutfit][index] = item->getId(); - mItemColors[mCurrentOutfit][index] = item->getColor(); - dragDrop.clear(); - dragDrop.deselect(); - } + mItems[mCurrentOutfit][index] = dragDrop.getItem(); + mItemColors[mCurrentOutfit][index] = dragDrop.getItemColor(); + dragDrop.clear(); + dragDrop.deselect(); } if (mItemClicked) mItemClicked = false; -- cgit v1.2.3-70-g09d2