aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kscripts.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-06-26 22:50:39 +0000
committerFilippos Karapetis2010-06-26 22:50:39 +0000
commitb2f2c48c7e31d322399997f30d4e32369806f60e (patch)
treef3e2396c3b7ce2cb48b70b28aaa4c1a964c9b52f /engines/sci/engine/kscripts.cpp
parente2026f4a26c648482b1823938c2d4a496ed56375 (diff)
downloadscummvm-rg350-b2f2c48c7e31d322399997f30d4e32369806f60e.tar.gz
scummvm-rg350-b2f2c48c7e31d322399997f30d4e32369806f60e.tar.bz2
scummvm-rg350-b2f2c48c7e31d322399997f30d4e32369806f60e.zip
Added a workaround for broken script 377 in Castle of Dr. Brain, room 320. It constantly tries to free the saved area rectangle (underbits) underneath the popup window
svn-id: r50352
Diffstat (limited to 'engines/sci/engine/kscripts.cpp')
-rw-r--r--engines/sci/engine/kscripts.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index de8710bd83..ed2ce6ed9e 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -80,6 +80,14 @@ reg_t kUnLoad(EngineState *s, int argc, reg_t *argv) {
ResourceType restype = (ResourceType)(argv[0].toUint16() & 0x7f);
reg_t resnr = argv[1];
+ // WORKAROUND for a broken script in room 320 in Castle of Dr. Brain.
+ // Script 377 tries to free the hunk memory allocated for the saved area
+ // (underbits) beneath the pop up window, which results in having the
+ // window stay on screen even when it's closed. Ignore this request here.
+ if (restype == kResourceTypeMemory && g_sci->getGameId() == GID_CASTLEBRAIN &&
+ s->currentRoomNumber() == 320)
+ return s->r_acc;
+
if (restype == kResourceTypeMemory)
s->_segMan->freeHunkEntry(resnr);