diff options
author | Max Horn | 2003-05-20 12:54:04 +0000 |
---|---|---|
committer | Max Horn | 2003-05-20 12:54:04 +0000 |
commit | c8169afe2b888ab900a8a9c12822e09998d0c587 (patch) | |
tree | e442ba91685b0b3e0f43e2ff70742462a36eddcc /scumm/boxes.cpp | |
parent | 46abb7998f20f857631851ede9505a674fd61d66 (diff) | |
download | scummvm-rg350-c8169afe2b888ab900a8a9c12822e09998d0c587.tar.gz scummvm-rg350-c8169afe2b888ab900a8a9c12822e09998d0c587.tar.bz2 scummvm-rg350-c8169afe2b888ab900a8a9c12822e09998d0c587.zip |
proper fix for getPathToDestBox
svn-id: r7721
Diffstat (limited to 'scumm/boxes.cpp')
-rw-r--r-- | scumm/boxes.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp index ee7b3d18c3..30cf6e9f98 100644 --- a/scumm/boxes.cpp +++ b/scumm/boxes.cpp @@ -571,7 +571,13 @@ int Scumm::getPathToDestBox(byte from, byte to) { if (from == to) return to; - assert(from < numOfBoxes || from == Actor::INVALID_BOX); + if (to == Actor::INVALID_BOX) + return -1; + + if (from == Actor::INVALID_BOX) + return to; + + assert(from < numOfBoxes); assert(to < numOfBoxes); boxm = getBoxMatrixBaseAddr(); |