[Scummvm-git-logs] scummvm master -> 1e3a6be863033924c6f9e867ae94c9f8e5be21a0

dreammaster dreammaster at scummvm.org
Sat Aug 5 17:26:51 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1e3a6be863 TITANIC: Fix arrow keys allow getting to bridge before Titania is fixed


Commit: 1e3a6be863033924c6f9e867ae94c9f8e5be21a0
    https://github.com/scummvm/scummvm/commit/1e3a6be863033924c6f9e867ae94c9f8e5be21a0
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-08-05T11:26:41-04:00

Commit Message:
TITANIC: Fix arrow keys allow getting to bridge before Titania is fixed

Changed paths:
    engines/titanic/core/view_item.cpp


diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index 5f51cfc..3355dcb 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) {





More information about the Scummvm-git-logs mailing list