aboutsummaryrefslogtreecommitdiff
path: root/engines/access/events.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2014-11-13 20:31:44 -0500
committerPaul Gilbert2014-12-12 22:32:36 -0500
commit2daa96e2840fd608f8968226ae44715ccf26c977 (patch)
treef9d7ce327d155058431cc4b6f682e9fae0209c96 /engines/access/events.cpp
parentc4a5c36290e59d47272cb47244f294696cc6c5c1 (diff)
downloadscummvm-rg350-2daa96e2840fd608f8968226ae44715ccf26c977.tar.gz
scummvm-rg350-2daa96e2840fd608f8968226ae44715ccf26c977.tar.bz2
scummvm-rg350-2daa96e2840fd608f8968226ae44715ccf26c977.zip
ACCESS: Fix crash in conversation screen when clicking outside response boxes
Diffstat (limited to 'engines/access/events.cpp')
-rw-r--r--engines/access/events.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/access/events.cpp b/engines/access/events.cpp
index 0287e8cb03..b05aea3025 100644
--- a/engines/access/events.cpp
+++ b/engines/access/events.cpp
@@ -254,7 +254,7 @@ Common::Point EventsManager::calcRawMouse() {
int EventsManager::checkMouseBox1(Common::Array<Common::Rect> &rects) {
int i = 0;
- for (i = 0;; i++) {
+ for (i = 0; i < rects.size(); ++i) {
if (rects[i].left == -1)
return -1;
@@ -262,6 +262,8 @@ int EventsManager::checkMouseBox1(Common::Array<Common::Rect> &rects) {
&& (_mousePos.y > rects[i].top) && (_mousePos.y < rects[i].bottom))
return i;
}
+
+ return -1;
}
bool EventsManager::isKeyMousePressed() {