aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kernel32.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-06-17 15:02:18 +0000
committerMatthew Hoops2010-06-17 15:02:18 +0000
commitf403d0f806d56dbe2017374792e0697e6d46bc1f (patch)
treefe1a52612a26877d6b0070470dcabf3ac8c0f41a /engines/sci/engine/kernel32.cpp
parent4e7b98db0cd978af5913ca3604fc72f4d4f7d7d9 (diff)
downloadscummvm-rg350-f403d0f806d56dbe2017374792e0697e6d46bc1f.tar.gz
scummvm-rg350-f403d0f806d56dbe2017374792e0697e6d46bc1f.tar.bz2
scummvm-rg350-f403d0f806d56dbe2017374792e0697e6d46bc1f.zip
Don't translate both x and y of the rect in kOnMe if only one of the variables is negative. Fixes the GKEgo hotspot outside of the Madame Cazanoux's house.
svn-id: r49933
Diffstat (limited to 'engines/sci/engine/kernel32.cpp')
-rw-r--r--engines/sci/engine/kernel32.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp
index a077f110cf..fb90cfb147 100644
--- a/engines/sci/engine/kernel32.cpp
+++ b/engines/sci/engine/kernel32.cpp
@@ -792,11 +792,15 @@ reg_t kOnMe(EngineState *s, int argc, reg_t *argv) {
nsRect.bottom = readSelectorValue(s->_segMan, targetObject, SELECTOR(nsBottom));
uint16 itemX = readSelectorValue(s->_segMan, targetObject, SELECTOR(x));
uint16 itemY = readSelectorValue(s->_segMan, targetObject, SELECTOR(y));
- if (nsRect.left < 0 || nsRect.top < 0) {
- // If top and left are negative, we need to adjust coordinates by the item's x and y
- // (e.g. happens in GK1, day 1, with detective Mosely's hotspot in his office)
- nsRect.translate(itemX, itemY);
- }
+
+ // If top and left are negative, we need to adjust coordinates by the item's x and y
+ // (e.g. happens in GK1, day 1, with detective Mosely's hotspot in his office)
+
+ if (nsRect.left < 0)
+ nsRect.translate(itemX, 0);
+
+ if (nsRect.top < 0)
+ nsRect.translate(0, itemY);
// HACK: nsLeft and nsTop can be invalid, so try and fix them here using x and y
// (e.g. with the inventory screen in GK1)