diff options
author | Max Horn | 2006-10-18 14:30:29 +0000 |
---|---|---|
committer | Max Horn | 2006-10-18 14:30:29 +0000 |
commit | 74c5d457e4e602ecf82d4c836e991fc288c3b6fa (patch) | |
tree | a9f92d9fbc5769ba6474af02ca22fcfbece4167f /engines/scumm | |
parent | 5e46a45aa544e4b536a2656102369de848959dc8 (diff) | |
download | scummvm-rg350-74c5d457e4e602ecf82d4c836e991fc288c3b6fa.tar.gz scummvm-rg350-74c5d457e4e602ecf82d4c836e991fc288c3b6fa.tar.bz2 scummvm-rg350-74c5d457e4e602ecf82d4c836e991fc288c3b6fa.zip |
SCUMM: Be less generous to code invoking checkXYInBoxBounds with a bad box param: we now abort instead of ignoring it silently. May cause some trivial-to-fix regressions
svn-id: r24369
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/boxes.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp index 269eaf5893..ebda290853 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -439,12 +439,7 @@ int ScummEngine_v6::getSpecialBox(int x, int y) { } bool ScummEngine::checkXYInBoxBounds(int b, int x, int y) { - BoxCoords box; - - if (b < 0 || b == Actor::kInvalidBox) - return false; - - box = getBoxCoordinates(b); + BoxCoords box = getBoxCoordinates(b); if (x < box.ul.x && x < box.ur.x && x < box.lr.x && x < box.ll.x) return false; @@ -458,8 +453,8 @@ bool ScummEngine::checkXYInBoxBounds(int b, int x, int y) { if (y > box.ul.y && y > box.ur.y && y > box.lr.y && y > box.ll.y) return false; - if (box.ul.x == box.ur.x && box.ul.y == box.ur.y && box.lr.x == box.ll.x && box.lr.y == box.ll.y || - box.ul.x == box.ll.x && box.ul.y == box.ll.y && box.ur.x == box.lr.x && box.ur.y == box.lr.y) { + if (box.ul == box.ur && box.lr == box.ll || + box.ul == box.ll && box.ur == box.lr) { Common::Point pt; pt = closestPtOnLine(box.ul, box.lr, x, y); |