aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2017-01-21 22:40:13 -0500
committerPaul Gilbert2017-01-21 22:40:13 -0500
commit1f7df903da4e1d02803da17bb249485d6e6e420c (patch)
tree1e91b5c6c6c11d976dacc7cf39627a728d9cfdaf /engines/titanic
parent7c2265659aa69aed7aceecc76d660bef3d830b99 (diff)
downloadscummvm-rg350-1f7df903da4e1d02803da17bb249485d6e6e420c.tar.gz
scummvm-rg350-1f7df903da4e1d02803da17bb249485d6e6e420c.tar.bz2
scummvm-rg350-1f7df903da4e1d02803da17bb249485d6e6e420c.zip
TITANIC: Fix second parameter for isEquals method
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/carry/hose.cpp2
-rw-r--r--engines/titanic/core/drop_target.cpp8
-rw-r--r--engines/titanic/core/drop_target.h2
-rw-r--r--engines/titanic/core/named_item.cpp6
-rw-r--r--engines/titanic/core/named_item.h2
-rw-r--r--engines/titanic/core/tree_item.h2
6 files changed, 11 insertions, 11 deletions
diff --git a/engines/titanic/carry/hose.cpp b/engines/titanic/carry/hose.cpp
index 3bfb4eae47..cbca3beea7 100644
--- a/engines/titanic/carry/hose.cpp
+++ b/engines/titanic/carry/hose.cpp
@@ -103,7 +103,7 @@ bool CHose::HoseConnectedMsg(CHoseConnectedMsg *msg) {
CHose *hose = dynamic_cast<CHose *>(findChildInstanceOf(CHose::_type));
if (hose) {
setVisible(true);
- petAddToInventory();
+ hose->petAddToInventory();
}
}
diff --git a/engines/titanic/core/drop_target.cpp b/engines/titanic/core/drop_target.cpp
index ffeab03545..d021705e05 100644
--- a/engines/titanic/core/drop_target.cpp
+++ b/engines/titanic/core/drop_target.cpp
@@ -34,7 +34,7 @@ BEGIN_MESSAGE_MAP(CDropTarget, CGameObject)
END_MESSAGE_MAP()
CDropTarget::CDropTarget() : CGameObject(), _itemFrame(0),
- _itemMatchSize(0), _showItem(false), _dropEnabled(false), _dropFrame(0),
+ _itemMatchStartsWith(false), _showItem(false), _dropEnabled(false), _dropFrame(0),
_dragFrame(0), _dragCursorId(CURSOR_ARROW), _dropCursorId(CURSOR_HAND),
_clipFlags(20) {
}
@@ -44,7 +44,7 @@ void CDropTarget::save(SimpleFile *file, int indent) {
file->writePoint(_pos1, indent);
file->writeNumberLine(_itemFrame, indent);
file->writeQuotedLine(_itemMatchName, indent);
- file->writeNumberLine(_itemMatchSize, indent);
+ file->writeNumberLine(_itemMatchStartsWith, indent);
file->writeQuotedLine(_soundName, indent);
file->writeNumberLine(_showItem, indent);
file->writeQuotedLine(_itemName, indent);
@@ -64,7 +64,7 @@ void CDropTarget::load(SimpleFile *file) {
_pos1 = file->readPoint();
_itemFrame = file->readNumber();
_itemMatchName = file->readString();
- _itemMatchSize = file->readNumber();
+ _itemMatchStartsWith = file->readNumber();
_soundName = file->readString();
_showItem = file->readNumber();
_itemName = file->readString();
@@ -87,7 +87,7 @@ bool CDropTarget::DropObjectMsg(CDropObjectMsg *msg) {
}
}
- if (!msg->_item->isEquals(_itemMatchName, _itemMatchSize))
+ if (!msg->_item->isEquals(_itemMatchName, _itemMatchStartsWith))
return false;
msg->_item->detach();
diff --git a/engines/titanic/core/drop_target.h b/engines/titanic/core/drop_target.h
index bdf8891789..d77efb4ce3 100644
--- a/engines/titanic/core/drop_target.h
+++ b/engines/titanic/core/drop_target.h
@@ -38,7 +38,7 @@ protected:
Point _pos1;
int _itemFrame;
CString _itemMatchName;
- int _itemMatchSize;
+ bool _itemMatchStartsWith;
CString _soundName;
bool _showItem;
CString _itemName;
diff --git a/engines/titanic/core/named_item.cpp b/engines/titanic/core/named_item.cpp
index 9c4c28d04d..5fb4f8d6b4 100644
--- a/engines/titanic/core/named_item.cpp
+++ b/engines/titanic/core/named_item.cpp
@@ -51,9 +51,9 @@ void CNamedItem::load(SimpleFile *file) {
CTreeItem::load(file);
}
-bool CNamedItem::isEquals(const CString &name, int maxLen) const {
- if (maxLen) {
- return getName().left(maxLen).compareToIgnoreCase(name) == 0;
+bool CNamedItem::isEquals(const CString &name, bool startsWith) const {
+ if (startsWith) {
+ return getName().left(name.size()).compareToIgnoreCase(name) == 0;
} else {
return getName().compareToIgnoreCase(name) == 0;
}
diff --git a/engines/titanic/core/named_item.h b/engines/titanic/core/named_item.h
index 9ee3d490ae..9d46fe0673 100644
--- a/engines/titanic/core/named_item.h
+++ b/engines/titanic/core/named_item.h
@@ -61,7 +61,7 @@ public:
/**
* Returns true if the item's name matches a passed name
*/
- virtual bool isEquals(const CString &name, int maxLen = 0) const;
+ virtual bool isEquals(const CString &name, bool startsWith = false) const;
/**
* Find a parent node for the item
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index e92f5cda49..498d2da4f4 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -127,7 +127,7 @@ public:
/**
* Returns true if the item's name matches a passed name
*/
- virtual bool isEquals(const CString &name, int maxLen = 0) const { return false; }
+ virtual bool isEquals(const CString &name, bool startsWith = false) const{ return false; }
/**
* Compares the name of the item to a passed name