From ee802724166c6cd8969493fac8660037fdd4774c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 18 Dec 2016 18:31:46 -0500 Subject: TITANIC: Fix returning items to inventory if drop doesn't work --- engines/titanic/carry/carry.cpp | 6 ++---- engines/titanic/input_handler.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/engines/titanic/carry/carry.cpp b/engines/titanic/carry/carry.cpp index 670c3780d9..075b2b32b3 100644 --- a/engines/titanic/carry/carry.cpp +++ b/engines/titanic/carry/carry.cpp @@ -149,8 +149,7 @@ bool CCarry::MouseDragEndMsg(CMouseDragEndMsg *msg) { return true; } - CString viewName = getViewFullName(); - if (viewName.empty() || msg->_mousePos.y >= 360) { + if (!compareViewNameTo(_fullViewName) || msg->_mousePos.y >= 360) { sleep(250); petAddToInventory(); } else { @@ -184,8 +183,7 @@ bool CCarry::UseWithOtherMsg(CUseWithOtherMsg *msg) { CShowTextMsg textMsg(_string3); textMsg.execute("PET"); - _fullViewName = getViewFullName(); - if (_fullViewName.empty() || _bounds.top >= 360) { + if (!compareViewNameTo(_fullViewName) || _bounds.top >= 360) { sleep(250); petAddToInventory(); } else { diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp index e2d1bd7a32..e4c60d24e9 100644 --- a/engines/titanic/input_handler.cpp +++ b/engines/titanic/input_handler.cpp @@ -155,7 +155,7 @@ CGameObject *CInputHandler::dragEnd(const Point &pt, CTreeItem *dragItem) { if (!view) return nullptr; - // Scan through the view items to find the item being dropped on + // Scan through the view items to find the element being dropped on CGameObject *target = nullptr; for (CTreeItem *treeItem = view->scan(view); treeItem; treeItem = treeItem->scan(view)) { CGameObject *gameObject = dynamic_cast(treeItem); -- cgit v1.2.3