aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-09-12 21:50:52 +0000
committerFilippos Karapetis2010-09-12 21:50:52 +0000
commitb6488818a549025313e23bfd9c111214cdd3d591 (patch)
tree961b53a99065dd0895108ca4c57a53ed9aa78c66 /engines
parentfc11604e73e7d827699a072b6bc16411144c96ff (diff)
downloadscummvm-rg350-b6488818a549025313e23bfd9c111214cdd3d591.tar.gz
scummvm-rg350-b6488818a549025313e23bfd9c111214cdd3d591.tar.bz2
scummvm-rg350-b6488818a549025313e23bfd9c111214cdd3d591.zip
SCI: Bugfix for rev #52688.
We can't just set the lockers of script 0 to 1, as at that point the objects associated with the script are marked to be deleted, thus we need to reload the script svn-id: r52693
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/script.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 719d01162c..81094c6f59 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -314,11 +314,20 @@ void Script::decrementLockers() {
// WORKAROUND for bug #3038837: HOYLE3: EGA/VGA Crashes
// This is caused by script 0 lockers reaching zero. Since
// this should never happen, I'm confident in making this a
- // non-specific fix.
+ // non-specific fix. We can't just reset lockers to 1, because
+ // the objects associated with the script are already marked
+ // to be deleted at this point, thus we need to reload the
+ // script itself. If we don't, the game will surely error
+ // out later on, because of objects associated with this
+ // script which are incorrectly marked to be deleted. For
+ // example, in Hoyle 3, if you exit Checkers and reenter
+ // checkers, the game will crash when selecting a player.
//
// TODO: Figure out why this happens, and fix it properly!
- if (_nr == 0 && _lockers == 0)
- _lockers++;
+ if (_nr == 0 && _lockers == 0) {
+ init(0, g_sci->getResMan());
+ load(g_sci->getResMan());
+ }
}