aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorPaul Gilbert2017-08-05 11:26:41 -0400
committerPaul Gilbert2017-08-05 11:26:41 -0400
commit1e3a6be863033924c6f9e867ae94c9f8e5be21a0 (patch)
tree96c34b365f5853d6cc341d5d8aebd6fd7b9f6e84 /engines/titanic
parentb4a41a04ac1d365ee1a845176113fadc83ad4409 (diff)
downloadscummvm-rg350-1e3a6be863033924c6f9e867ae94c9f8e5be21a0.tar.gz
scummvm-rg350-1e3a6be863033924c6f9e867ae94c9f8e5be21a0.tar.bz2
scummvm-rg350-1e3a6be863033924c6f9e867ae94c9f8e5be21a0.zip
TITANIC: Fix arrow keys allow getting to bridge before Titania is fixed
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/core/view_item.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 5f51cfc931..3355dcb074 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -391,10 +391,15 @@ bool CViewItem::VirtualKeyCharMsg(CVirtualKeyCharMsg *msg) {
}
CursorId CViewItem::getLinkCursor(CLinkItem *link) {
- Common::Point pt(link->_bounds.left, link->_bounds.top);
- Common::Array<CGameObject *> gameObjects;
+ // Pick the center of the link's region as a check point
+ Common::Point pt((link->_bounds.left + link->_bounds.right) / 2,
+ (link->_bounds.top + link->_bounds.bottom) / 2);
+ if (link->_bounds.isEmpty())
+ // Bridge doorway link has an empty bounds, so workaround it
+ pt = Common::Point(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2);
// Scan for a restricted object covering the link
+ Common::Array<CGameObject *> gameObjects;
for (CTreeItem *treeItem = scan(this); treeItem; treeItem = treeItem->scan(this)) {
CGameObject *gameObject = dynamic_cast<CGameObject *>(treeItem);
if (gameObject) {