diff options
author | Filippos Karapetis | 2010-06-15 14:55:52 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-15 14:55:52 +0000 |
commit | ab558b45d252743797bca27d2240bf0e2057863f (patch) | |
tree | 4fbf921861da541fb69cad6fc7c37f388555add1 /engines | |
parent | ddb5a769a2e4f74c1da945914a67e169bc94bafb (diff) | |
download | scummvm-rg350-ab558b45d252743797bca27d2240bf0e2057863f.tar.gz scummvm-rg350-ab558b45d252743797bca27d2240bf0e2057863f.tar.bz2 scummvm-rg350-ab558b45d252743797bca27d2240bf0e2057863f.zip |
Fixed detective Mosely's hotspot in GK1 (day 1)
svn-id: r49857
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kernel32.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/sci/engine/kernel32.cpp b/engines/sci/engine/kernel32.cpp index 2b00daf34a..8c5cb019b9 100644 --- a/engines/sci/engine/kernel32.cpp +++ b/engines/sci/engine/kernel32.cpp @@ -792,12 +792,18 @@ reg_t kOnMe(EngineState *s, int argc, reg_t *argv) { nsRect.top = readSelectorValue(s->_segMan, targetObject, SELECTOR(nsTop)); nsRect.right = readSelectorValue(s->_segMan, targetObject, SELECTOR(nsRight)); 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 + nsRect.translate(itemX, 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 or detective Mosely in his office) + // Not sure why this is happening, but at least this hack fixes most of the issues if (nsRect.left == itemY && nsRect.top == itemX) { - // FIXME: Why is this happening?? - // Swap the values, as they're inversed(eh???) + // Swap the values, as they're inversed (eh???) nsRect.left = itemX; nsRect.top = itemY; } |