aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-12-18 18:31:46 -0500
committerPaul Gilbert2016-12-18 18:31:46 -0500
commitee802724166c6cd8969493fac8660037fdd4774c (patch)
tree532de9bcfda41cfd470cb0e1b2ee03845e543363
parentcf061845ba68a6c2a7a84898c56b4d4ffc9b714e (diff)
downloadscummvm-rg350-ee802724166c6cd8969493fac8660037fdd4774c.tar.gz
scummvm-rg350-ee802724166c6cd8969493fac8660037fdd4774c.tar.bz2
scummvm-rg350-ee802724166c6cd8969493fac8660037fdd4774c.zip
TITANIC: Fix returning items to inventory if drop doesn't work
-rw-r--r--engines/titanic/carry/carry.cpp6
-rw-r--r--engines/titanic/input_handler.cpp2
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<CGameObject *>(treeItem);