aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authormd52011-03-10 19:18:37 +0200
committermd52011-03-10 19:18:37 +0200
commit0929d1e12d1f03dd115ee98a5b8a85033458e465 (patch)
tree665ccc3029d238d429ff5860f17ca4e440374b69 /engines
parent91d2d04f90d020ab9a4eee9b16c0f95dcd6737bd (diff)
downloadscummvm-rg350-0929d1e12d1f03dd115ee98a5b8a85033458e465.tar.gz
scummvm-rg350-0929d1e12d1f03dd115ee98a5b8a85033458e465.tar.bz2
scummvm-rg350-0929d1e12d1f03dd115ee98a5b8a85033458e465.zip
SCI: Don't try to uninstantiate scripts marked as deleted
Trying to delete a script marked as deleted should do nothing. Hoyle 3 tried to uninstantiate scripts more than once, and we incorrectly decreased the reference count of associated scripts more than once, thereby killing them. This properly fixes bug #3038837 (removed the hack for it). Many many thanks to wjp for his help on this :)
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/seg_manager.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index 2be3184b59..a3e5239906 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -1021,7 +1021,7 @@ void SegManager::uninstantiateScript(int script_nr) {
SegmentId segmentId = getScriptSegment(script_nr);
Script *scr = getScriptIfLoaded(segmentId);
- if (!scr) { // Is it already unloaded?
+ if (!scr || scr->isMarkedAsDeleted()) { // Is it already unloaded?
//warning("unloading script 0x%x requested although not loaded", script_nr);
// This is perfectly valid SCI behaviour
return;
@@ -1078,15 +1078,7 @@ void SegManager::uninstantiateScriptSci0(int script_nr) {
if (scr->getLockers())
scr->decrementLockers(); // Decrease lockers if this is us ourselves
} else {
- if (g_sci->getGameId() == GID_HOYLE3 && (superclass_script == 0 || superclass_script >= 990)) {
- // HACK for Hoyle 3: when exiting Checkers or Pachisi, scripts 0, 999 and some others
- // are deleted but are never instantiated again. We ignore deletion of these scripts
- // here for Hoyle 3 - bug #3038837
- // TODO/FIXME: find out why this happens, seems like there is a problem with the object
- // lock code
- } else {
- uninstantiateScript(superclass_script);
- }
+ uninstantiateScript(superclass_script);
}
// Recurse to assure that the superclass lockers number gets decreased
}