From b2f2c48c7e31d322399997f30d4e32369806f60e Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 26 Jun 2010 22:50:39 +0000 Subject: 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 --- engines/sci/engine/kscripts.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/sci') 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); -- cgit v1.2.3