aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/boxes.cpp
diff options
context:
space:
mode:
authorMax Horn2007-02-03 23:10:17 +0000
committerMax Horn2007-02-03 23:10:17 +0000
commit69ba8e57c2c16be3ec19af88cd46e427fc9f64ea (patch)
tree1cf1b4cff096037b10a84b879f437064f5edb093 /engines/scumm/boxes.cpp
parent35bfb505a6b8991eec0c589f30c9f4111c1daa8c (diff)
downloadscummvm-rg350-69ba8e57c2c16be3ec19af88cd46e427fc9f64ea.tar.gz
scummvm-rg350-69ba8e57c2c16be3ec19af88cd46e427fc9f64ea.tar.bz2
scummvm-rg350-69ba8e57c2c16be3ec19af88cd46e427fc9f64ea.zip
Changed old FIXME comment into a WORKAROUND comment (it worked fine all these years, after all :); also added some paranoia checks
svn-id: r25366
Diffstat (limited to 'engines/scumm/boxes.cpp')
-rw-r--r--engines/scumm/boxes.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp
index d00e7a8bc0..df5c58fe69 100644
--- a/engines/scumm/boxes.cpp
+++ b/engines/scumm/boxes.cpp
@@ -585,13 +585,10 @@ BoxCoords ScummEngine::getBoxCoordinates(int boxnum) {
box->lr.x = (short)FROM_LE_32(bp->v8.lrx);
box->lr.y = (short)FROM_LE_32(bp->v8.lry);
- // FIXME: Some walkboxes in CMI appear to have been flipped,
- // in the sense that for instance the lower boundary is above
- // the upper one. Can that really be the case, or is there
- // some more sinister problem afoot?
- //
- // Is this fix sufficient, or will we need something more
- // elaborate?
+ // WORKAROUND (see patch #684732): Some walkboxes in CMI appear
+ // to have been flipped, in the sense that for instance the
+ // lower boundary is above the upper one. We work around this
+ // by simply flipping them back.
if (box->ul.y > box->ll.y && box->ur.y > box->lr.y) {
SWAP(box->ul, box->ll);
@@ -779,6 +776,7 @@ int ScummEngine::getPathToDestBox(byte from, byte to) {
* line in order to get from box1 to box3 via box2.
*/
bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, Common::Point &foundPath) {
+ assert(_game.version >= 3);
BoxCoords box1 = _vm->getBoxCoordinates(box1nr);
BoxCoords box2 = _vm->getBoxCoordinates(box2nr);
Common::Point tmp;
@@ -1047,6 +1045,7 @@ bool ScummEngine::areBoxesNeighbours(int box1nr, int box2nr) {
if (getBoxFlags(box1nr) & kBoxInvisible || getBoxFlags(box2nr) & kBoxInvisible)
return false;
+ assert(_game.version >= 3);
box2 = getBoxCoordinates(box1nr);
box = getBoxCoordinates(box2nr);