diff options
author | Eugene Sandulenko | 2005-08-10 19:12:10 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-08-10 19:12:10 +0000 |
commit | 0af7371717f59199e2956d6643187de98235bede (patch) | |
tree | 7f5dba37efec61da0c8d652418de028d4abdbe3d /saga | |
parent | 42d4032b5991b5b152931c86d80f73423418a8c4 (diff) | |
download | scummvm-rg350-0af7371717f59199e2956d6643187de98235bede.tar.gz scummvm-rg350-0af7371717f59199e2956d6643187de98235bede.tar.bz2 scummvm-rg350-0af7371717f59199e2956d6643187de98235bede.zip |
More IHNM fixes. Now it tries to start Ellen part but crashes at invalid
opcode because it tries to execute string data.
svn-id: r18654
Diffstat (limited to 'saga')
-rw-r--r-- | saga/actor.cpp | 7 | ||||
-rw-r--r-- | saga/sthread.cpp | 9 |
2 files changed, 11 insertions, 5 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp index 70e379d157..2bd8e3f7f0 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -892,13 +892,16 @@ void Actor::updateActorsScene(int actorsEntrance) { ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) { ActorData *actor; int fourDirection; + static ActorFrameRange def = {0, 0}; actor = getActor(actorId); if (actor->_disabled) error("Actor::getActorFrameRange Wrong actorId 0x%X", actorId); - if (frameType >= actor->_framesCount) - error("Actor::getActorFrameRange Wrong frameType 0x%X (%d) actorId 0x%X", frameType, actor->_framesCount, actorId); + if (frameType >= actor->_framesCount) { + warning("Actor::getActorFrameRange Wrong frameType 0x%X (%d) actorId 0x%X", frameType, actor->_framesCount, actorId); + return &def; + } if ((actor->_facingDirection < kDirUp) || (actor->_facingDirection > kDirUpLeft)) error("Actor::getActorFrameRange Wrong direction 0x%X actorId 0x%X", actor->_facingDirection, actorId); diff --git a/saga/sthread.cpp b/saga/sthread.cpp index a61074f3ea..8cd6cb0977 100644 --- a/saga/sthread.cpp +++ b/saga/sthread.cpp @@ -228,17 +228,17 @@ bool Script::runThread(ScriptThread *thread, uint instructionLimit) { #define CASEOP(opName) case opName: \ if (operandChar == opName) { \ operandName = #opName; \ - debug(8, operandName); \ + debug(2, operandName); \ _vm->_console->DebugPrintf("%s\n", operandName); \ } -// debug(8, "Executing thread offset: %lu (%x) stack: %d", thread->_instructionOffset, operandChar, thread->pushedSize()); + debug(8, "Executing thread offset: %lu (%x) stack: %d", thread->_instructionOffset, operandChar, thread->pushedSize()); operandName=""; switch (operandChar) { CASEOP(opNextBlock) // Some sort of "jump to the start of the next memory // page" instruction, I think. - thread->_instructionOffset = 1024 * ((thread->_instructionOffset / 1024) + 1); + thread->_instructionOffset = (((thread->_instructionOffset) >> 10) + 1) << 10; break; // STACK INSTRUCTIONS @@ -615,6 +615,9 @@ bool Script::runThread(ScriptThread *thread, uint instructionLimit) { int16 first; const char *strings[ACTOR_SPEECH_STRING_MAX]; + if (_vm->getGameType() == GType_IHNM) + break; + if (_vm->_actor->isSpeaking()) { thread->wait(kWaitTypeSpeech); return false; |