From 1e3a6be863033924c6f9e867ae94c9f8e5be21a0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 5 Aug 2017 11:26:41 -0400 Subject: TITANIC: Fix arrow keys allow getting to bridge before Titania is fixed --- engines/titanic/core/view_item.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/titanic') 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 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 gameObjects; for (CTreeItem *treeItem = scan(this); treeItem; treeItem = treeItem->scan(this)) { CGameObject *gameObject = dynamic_cast(treeItem); if (gameObject) { -- cgit v1.2.3