diff options
author | Paul Gilbert | 2016-12-02 19:46:47 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-12-02 19:46:47 -0500 |
commit | 033d8e008e632f2880b6f52c643c33f389a0aa5f (patch) | |
tree | 56bf11f8609d21867bcae392264cece0c80430f9 /engines/titanic/pet_control | |
parent | 95b9644b2e1aef6b7008ee9705a87918ce9366af (diff) | |
download | scummvm-rg350-033d8e008e632f2880b6f52c643c33f389a0aa5f.tar.gz scummvm-rg350-033d8e008e632f2880b6f52c643c33f389a0aa5f.tar.bz2 scummvm-rg350-033d8e008e632f2880b6f52c643c33f389a0aa5f.zip |
TITANIC: Fix dragging inventory items onto the view
Diffstat (limited to 'engines/titanic/pet_control')
-rw-r--r-- | engines/titanic/pet_control/pet_inventory_glyphs.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp index e6087b5c02..d7918cf860 100644 --- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp +++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp @@ -112,6 +112,7 @@ bool CPetInventoryGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg return false; CGameObject *carryParcel = petControl->getHiddenObject("CarryParcel"); + CGameObject *item = _item; if (petControl->isSuccUBusActive() && carryParcel) { petControl->removeFromInventory(_item, carryParcel, false, true); @@ -119,17 +120,18 @@ bool CPetInventoryGlyph::dragGlyph(const Point &topLeft, CMouseDragStartMsg *msg carryParcel->setPosition(Point(msg->_mousePos.x - carryParcel->getBounds().width() / 2, msg->_mousePos.y - carryParcel->getBounds().height() / 2)); - _item->setPosition(Point(SCREEN_WIDTH, SCREEN_HEIGHT)); + carryParcel->setPosition(Point(SCREEN_WIDTH, SCREEN_HEIGHT)); + item = carryParcel; } else { petControl->removeFromInventory(_item, false, true); - _item->setPosition(Point(msg->_mousePos.x - carryParcel->getBounds().width() / 2, - msg->_mousePos.y - carryParcel->getBounds().height() / 2)); + _item->setPosition(Point(msg->_mousePos.x - _item->getBounds().width() / 2, + msg->_mousePos.y - _item->getBounds().height() / 2)); _item->setVisible(true); } msg->_handled = true; - if (msg->execute(carryParcel)) { + if (msg->execute(item)) { _item = nullptr; _background = nullptr; _field34 = 0; |