diff options
author | Torbjörn Andersson | 2005-10-17 06:45:54 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2005-10-17 06:45:54 +0000 |
commit | 290c8114de0b5ce09689253b4a9d8825a5c79c21 (patch) | |
tree | 54f4c0877db80fa66e095d1aad32bb34b6b2bf52 /sword2/sword2.cpp | |
parent | 1a717471ba30aabff6bf442666676a8ad2dbce16 (diff) | |
download | scummvm-rg350-290c8114de0b5ce09689253b4a9d8825a5c79c21.tar.gz scummvm-rg350-290c8114de0b5ce09689253b4a9d8825a5c79c21.tar.bz2 scummvm-rg350-290c8114de0b5ce09689253b4a9d8825a5c79c21.zip |
Fixed end credits crash. (See bug #1327650). Actually, there were several
more or less serious bugs here:
* The fnResetGlobals() function returned IR_CONT. Since it potentially
kills its own script resource, this can lead to illegal read accesses.
Not it returns IR_STOP instead. This was probably a bug in the original
interpreter as well, but it handled memory allocation quite differently
so it was probably never an issue.
* Since fnResetGlobals() forcibly closes resources, I've changed the
closeResource() function to silently ignore requests to close resources
where the data pointer is NULL. While it could signify an error, it isn't
necessarily so.
* Don't force the screen to fade up after the credits -- let the script do
it instead. This prevents it from fading up the wrong image.
svn-id: r19127
Diffstat (limited to 'sword2/sword2.cpp')
-rw-r--r-- | sword2/sword2.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp index 1d7927936c..fa31cf946e 100644 --- a/sword2/sword2.cpp +++ b/sword2/sword2.cpp @@ -332,8 +332,11 @@ int Sword2Engine::go() { pauseGame(); break; case 'c': - if (!Logic::_scriptVars[DEMO] && !_mouse->isChoosing()) + if (!Logic::_scriptVars[DEMO] && !_mouse->isChoosing()) { + ScreenInfo *screenInfo = _screen->getScreenInfo(); _logic->fnPlayCredits(NULL); + screenInfo->new_palette = 99; + } break; #ifdef SWORD2_DEBUG case ' ': |