aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/compare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/graphics/compare.cpp')
-rw-r--r--engines/sci/graphics/compare.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp
index 1dbe279f8a..3183ffa2b9 100644
--- a/engines/sci/graphics/compare.cpp
+++ b/engines/sci/graphics/compare.cpp
@@ -84,7 +84,14 @@ reg_t GfxCompare::canBeHereCheckRectList(reg_t checkObject, const Common::Rect &
curRect.right = readSelectorValue(_segMan, curObject, SELECTOR(brRight));
curRect.bottom = readSelectorValue(_segMan, curObject, SELECTOR(brBottom));
// Check if curRect is within checkRect
- if (checkRect.contains(curRect))
+ // This behavior is slightly odd, but it's how the original SCI
+ // engine did it: a rect cannot be contained within itself
+ // (there is no equality). Do NOT change this to contains(), as
+ // it breaks KQ4 early (bug #3315639).
+ if (curRect.right > checkRect.left &&
+ curRect.left < checkRect.right &&
+ curRect.bottom > checkRect.top &&
+ curRect.top < checkRect.bottom)
return curObject;
}
}