diff options
-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(); |