From cb2a20cbd05bd8d137eda0adf75609186271255d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 21 Nov 2010 05:31:13 +0000 Subject: CRUISE: Bugfix for #3064846 - Raoul appearing in Book screen svn-id: r54405 --- engines/cruise/cruise_main.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index ac814b3279..6b487fadc9 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -1886,11 +1886,27 @@ void CruiseEngine::mainLoop() { currentMouseButton = 0; } - manageScripts(&relHead); - manageScripts(&procHead); - - removeFinishedScripts(&relHead); - removeFinishedScripts(&procHead); + // FIXME: I suspect that the original game does multiple script executions between game frames; the bug with + // Raoul appearing when looking at the book is being there are 3 script iterations separation between the + // scene being changed to the book, and the Raoul actor being frozen/disabled. This loop is a hack to ensure + // that when a background changes, a few extra script executions are done + bool bgChanged; + int numIterations = 1; + + while (numIterations-- > 0) { + bgChanged = backgroundChanged[masterScreen]; + + manageScripts(&relHead); + manageScripts(&procHead); + + removeFinishedScripts(&relHead); + removeFinishedScripts(&procHead); + + if (!bgChanged && backgroundChanged[masterScreen]) { + bgChanged = true; + numIterations += 2; + } + } processAnimation(); -- cgit v1.2.3