diff options
-rw-r--r-- | actor.cpp | 2 | ||||
-rw-r--r-- | script.cpp | 13 | ||||
-rw-r--r-- | script_v1.cpp | 8 |
3 files changed, 17 insertions, 6 deletions
@@ -795,7 +795,7 @@ void Scumm::walkActor(Actor *a) { if (a->walkbox == a->walkdata.destbox) break; j = getPathToDestBox(a->walkbox,a->walkdata.destbox); - if (j==-1) { + if (j==-1 || j>0xF0) { a->walkdata.destbox = a->walkbox; a->moving |= 8; return; diff --git a/script.cpp b/script.cpp index 342c1ffff8..e8d03903cb 100644 --- a/script.cpp +++ b/script.cpp @@ -408,6 +408,7 @@ void Scumm::drawBox(int x, int y, int x2, int y2, int color) { if (x>319) return; if (x<0) x=0; + if (y<0) y=0; if (x2<0) return; if (x2>320) x2=320; if (y2 > bottom) y2=bottom; @@ -442,11 +443,15 @@ void Scumm::stopObjectCode() { } if (ss->where!=WIO_GLOBAL && ss->where!=WIO_LOCAL) { - if (ss->cutsceneOverride) - error("Object %d ending with active cutscene/override", ss->number); + if (ss->cutsceneOverride) { + warning("Object %d ending with active cutscene/override", ss->number); + ss->cutsceneOverride = 0; + } } else { - if (ss->cutsceneOverride) - error("Script %d ending with active cutscene/override (%d)", ss->number, ss->cutsceneOverride); + if (ss->cutsceneOverride) { + warning("Script %d ending with active cutscene/override (%d)", ss->number, ss->cutsceneOverride); + ss->cutsceneOverride = 0; + } } ss->number = 0; ss->status = 0; diff --git a/script_v1.cpp b/script_v1.cpp index 7f758ee62a..0b8505900f 100644 --- a/script_v1.cpp +++ b/script_v1.cpp @@ -1022,7 +1022,7 @@ void Scumm::o5_doSentence() { void Scumm::o5_drawBox() { int x,y,x2,y2,color; - + x = getVarOrDirectWord(0x80); y = getVarOrDirectWord(0x40); @@ -2351,6 +2351,9 @@ void Scumm::o5_walkActorToActor() { int nr; int nr2 = getVarOrDirectByte(0x80); a = derefActorSafe(nr2, "o5_walkActorToActor"); + if (!a) + return; + if (a->room != _currentRoom) { getVarOrDirectByte(0x40); fetchScriptByte(); @@ -2365,6 +2368,9 @@ void Scumm::o5_walkActorToActor() { } // warning("walk actor %d to actor %d", nr, nr2); a2 = derefActorSafe(nr, "o5_walkActorToActor(2)"); + if (!a2) + return; + if (a2->room != _currentRoom) { fetchScriptByte(); return; |