aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-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)