From 8c07c773886097e6dec989fd88e34d44ea8bba35 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 8 Oct 2014 07:37:44 +0200 Subject: [PATCH] MADS: Rex - Remove an erroneous assert on newPalIndex --- engines/mads/palette.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index eedbf36dddc0..c098e23bf902 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -143,7 +143,7 @@ int PaletteUsage::process(Common::Array &palette, uint flags) { for (uint palIndex = 0; palIndex < palette.size(); ++palIndex) { bool changed = false; - int newPalIndex = -1; + int newPalIndex = 0xFF; int v1 = palRange[palIndex]._v2; if (palette[v1]._flags & 8) { @@ -229,7 +229,10 @@ int PaletteUsage::process(Common::Array &palette, uint flags) { // In at least scene 318, when the doctor knocks you with the blackjack, // the changed flag can be false //assert(changed); - assert(newPalIndex != -1); + + // CHECKME: When pressing on F1 in the first screen, newPalIndex is set to 0xFF at this point + // which is a valid value for the index. Maybe a better check would be "< 256" ? + //assert(newPalIndex != -1); int var52 = (noUsageFlag && palette[palIndex]._u2) ? 2 : 0;