From f403d0f806d56dbe2017374792e0697e6d46bc1f Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 17 Jun 2010 15:02:18 +0000 Subject: 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 --- engines/sci/engine/kernel32.cpp | 14 +++++++++----- 1 file 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) -- cgit v1.2.3