aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-11-17 13:01:58 +0000
committerMax Horn2010-11-17 13:01:58 +0000
commit3d7f7b49fe86e2ec8d637d9d5df5c8cb11969734 (patch)
tree8f8e678b2aa98c14ad50de3db81410f5641f5c0e
parent58e4d9a97a90d98be37863a519d377fd4a313192 (diff)
downloadscummvm-rg350-3d7f7b49fe86e2ec8d637d9d5df5c8cb11969734.tar.gz
scummvm-rg350-3d7f7b49fe86e2ec8d637d9d5df5c8cb11969734.tar.bz2
scummvm-rg350-3d7f7b49fe86e2ec8d637d9d5df5c8cb11969734.zip
SCI: Make class table size OB1 workaround slightly more readable
svn-id: r54290
-rw-r--r--engines/sci/engine/script.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index a18ef6ce10..e21fb0223f 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -537,14 +537,16 @@ void Script::initialiseClasses(SegManager *segMan) {
if (isClass) {
// WORKAROUNDs for off-by-one script errors
- if (g_sci->getGameId() == GID_LSL2 && g_sci->isDemo() && species == (int)segMan->classTableSize())
- segMan->resizeClassTable(segMan->classTableSize() + 1);
- if (g_sci->getGameId() == GID_LSL3 && !g_sci->isDemo() && _nr == 500 && species == (int)segMan->classTableSize())
- segMan->resizeClassTable(segMan->classTableSize() + 1);
- if (g_sci->getGameId() == GID_SQ3 && !g_sci->isDemo() && _nr == 93 && species == (int)segMan->classTableSize())
- segMan->resizeClassTable(segMan->classTableSize() + 1);
- if (g_sci->getGameId() == GID_SQ3 && !g_sci->isDemo() && _nr == 99 && species == (int)segMan->classTableSize())
- segMan->resizeClassTable(segMan->classTableSize() + 1);
+ if (species == (int)segMan->classTableSize()) {
+ if (g_sci->getGameId() == GID_LSL2 && g_sci->isDemo())
+ segMan->resizeClassTable(species + 1);
+ else if (g_sci->getGameId() == GID_LSL3 && !g_sci->isDemo() && _nr == 500)
+ segMan->resizeClassTable(species + 1);
+ else if (g_sci->getGameId() == GID_SQ3 && !g_sci->isDemo() && _nr == 93)
+ segMan->resizeClassTable(species + 1);
+ else if (g_sci->getGameId() == GID_SQ3 && !g_sci->isDemo() && _nr == 99)
+ segMan->resizeClassTable(species + 1);
+ }
if (species < 0 || species >= (int)segMan->classTableSize())
error("Invalid species %d(0x%x) unknown max %d(0x%x) while instantiating script %d\n",