diff options
author | James Brown | 2002-11-08 18:06:08 +0000 |
---|---|---|
committer | James Brown | 2002-11-08 18:06:08 +0000 |
commit | 1bf9bb768ed3d6ef438c8ff81b5cceffd01a6232 (patch) | |
tree | fcfa29255a7892c237111ddd394bb28ca2f0ec84 /scumm | |
parent | 70f3aff2c8c9e01f65b98d9c676dfb021fa4dc80 (diff) | |
download | scummvm-rg350-1bf9bb768ed3d6ef438c8ff81b5cceffd01a6232.tar.gz scummvm-rg350-1bf9bb768ed3d6ef438c8ff81b5cceffd01a6232.tar.bz2 scummvm-rg350-1bf9bb768ed3d6ef438c8ff81b5cceffd01a6232.zip |
Fix Indy3 "Guard-Fighting" crash and properly fix the empty exits problem
svn-id: r5467
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/script.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index ec6ec74202..cc87340788 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -640,10 +640,18 @@ void Scumm::runExitScript() // not actual data not even a 00 (stop code) // maybe we should be limiting ourselves to strictly reading the size // described in the header? - if ((_currentRoom == 7) && (_gameId == GID_INDY3_256)) - printf("skipping specific exit script as its empty, fix properly!\n"); - else - runScriptNested(slot); + if (_gameId == GID_INDY3_256) { + // FIXME: Oddly, Indy3 seems to contain exit scripts with only a size + // and a tag - not even a terminating NULL! + byte *roomptr = getResourceAddress(rtRoom, _roomResource); + byte *excd = findResourceData(MKID('EXCD'), roomptr) - _resourceHeaderSize; + if (!excd || (getResourceDataSize(excd) < 1)) { + debug(2, "Exit-%d is empty", _roomResource); + return; + } + } + + runScriptNested(slot); } if (_vars[VAR_EXIT_SCRIPT2]) runScript(_vars[VAR_EXIT_SCRIPT2], 0, 0, 0); |