diff options
author | Paul Gilbert | 2015-07-31 21:43:35 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-07-31 21:43:35 -0400 |
commit | 989ba681bc06ecf0b7965916b36a0da7c99ee115 (patch) | |
tree | cae93f3463d45be09846b8748e22bfc8c964683a /engines/sherlock/tattoo | |
parent | 8fd588072d545b147f0bfacd68921aea109df786 (diff) | |
download | scummvm-rg350-989ba681bc06ecf0b7965916b36a0da7c99ee115.tar.gz scummvm-rg350-989ba681bc06ecf0b7965916b36a0da7c99ee115.tar.bz2 scummvm-rg350-989ba681bc06ecf0b7965916b36a0da7c99ee115.zip |
SHERLOCK: RT: Mousing over an NPC overrides any bg object at the same place
Diffstat (limited to 'engines/sherlock/tattoo')
-rw-r--r-- | engines/sherlock/tattoo/tattoo_scene.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp index 13206f0dac..2e837968e7 100644 --- a/engines/sherlock/tattoo/tattoo_scene.cpp +++ b/engines/sherlock/tattoo/tattoo_scene.cpp @@ -748,21 +748,21 @@ int TattooScene::findBgShape(const Common::Point &pt) { // New frame hasn't been drawn yet return -1; - - for (int idx = (int)_bgShapes.size() - 1; idx >= 0; --idx) { + int result = -1; + for (int idx = (int)_bgShapes.size() - 1; idx >= 0 && result == -1; --idx) { Object &o = _bgShapes[idx]; if (o._type != INVALID && o._type != NO_SHAPE && o._type != HIDDEN && (o._aType <= PERSON || (ui._menuMode == LAB_MODE && o._aType == SOLID))) { if (o.getNewBounds().contains(pt)) - return idx; + result = idx; } else if (o._type == NO_SHAPE) { if (o.getNoShapeBounds().contains(pt)) - return idx; + result = idx; } } - // If no shape found, so check whether a character is highlighted + // Now check for the mouse being over an NPC. If so, it overrides any found bg object for (int idx = 1; idx < MAX_CHARACTERS; ++idx) { Person &person = people[idx]; @@ -778,11 +778,11 @@ int TattooScene::findBgShape(const Common::Point &pt) { - charRect.height()); if (charRect.contains(pt)) - return 1000 + idx; + result = 1000 + idx; } } - return -1; + return result; } void TattooScene::synchronize(Serializer &s) { |