From 793849c97480da2e2f9b0b08e004d33205984bc2 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Mon, 23 May 2011 23:19:44 +0200 Subject: TINSEL: Fix bug #3306020, DW2: Crash On Entering Sewers This is the cowardly fix that reintroduces one of the variables that was removed by a cleanup on April 10. --- engines/tinsel/handle.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index 6f5f92c969..c0daa1869a 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -79,6 +79,7 @@ static uint numHandles = 0; static uint32 cdPlayHandle = (uint32)-1; +static int cdPlaySceneNum; static SCNHANDLE cdBaseHandle = 0, cdTopHandle = 0; static Common::File *cdGraphStream = 0; @@ -246,7 +247,9 @@ void LoadCDGraphData(MEMHANDLE *pH) { * @param next Handle of end of range + 1 */ void LoadExtraGraphData(SCNHANDLE start, SCNHANDLE next) { - if (start == cdBaseHandle) + // It's not clear that this can ever be true. See bug #3306020, DW2: + // Crash On Entering Sewers, for some background information. + if (cdPlaySceneNum == 0 && start == cdBaseHandle) return; OpenCDGraphFile(); @@ -262,6 +265,7 @@ void LoadExtraGraphData(SCNHANDLE start, SCNHANDLE next) { } void SetCdPlaySceneDetails(int fileNum, const char *fileName) { + cdPlaySceneNum = fileNum; strcpy(szCdPlayFile, fileName); } -- cgit v1.2.3