aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-10-16 08:29:46 +1100
committerPaul Gilbert2011-10-16 13:54:54 +1100
commit0af554b891eb35a222688d5e3df3639afaa3f097 (patch)
treeca37beeb40a4d1ce72735a913d78acef849a15d2
parentcc5f37823bef3549096e1d6a99e4edea929fca29 (diff)
downloadscummvm-rg350-0af554b891eb35a222688d5e3df3639afaa3f097.tar.gz
scummvm-rg350-0af554b891eb35a222688d5e3df3639afaa3f097.tar.bz2
scummvm-rg350-0af554b891eb35a222688d5e3df3639afaa3f097.zip
TSAGE: Workaround for script bug in Blue Force using invalid visage rlb indexes.
This affects the inspection cut-scene on Day 2
-rw-r--r--engines/tsage/core.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index f4118cb45e..6029a91daa 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -2814,6 +2814,11 @@ void Visage::setVisage(int resNum, int rlbNum) {
if (rlbNum == 0)
rlbNum = 1;
+ // Check how many slots there are
+ uint16 count = READ_LE_UINT16(indexData);
+ if (rlbNum > count)
+ rlbNum = count;
+
// Get the flags/rlbNum to use
uint32 v = READ_LE_UINT32(indexData + (rlbNum - 1) * 4 + 2);
int flags = v >> 30;