From b6488818a549025313e23bfd9c111214cdd3d591 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 12 Sep 2010 21:50:52 +0000 Subject: 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 --- engines/sci/engine/script.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'engines/sci/engine/script.cpp') 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()); + } } -- cgit v1.2.3