aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script_v6.cpp
diff options
context:
space:
mode:
authorTravis Howell2010-12-27 14:02:17 +0000
committerTravis Howell2010-12-27 14:02:17 +0000
commite7e92a7577fcaadd4d63483a41ab2a71d913c3d6 (patch)
tree4d180744b7e3e0c95e9ee14a8b5f4cd949cfc050 /engines/scumm/script_v6.cpp
parent4f3623964465a6d42d99b0fa37ba9073e948c79f (diff)
downloadscummvm-rg350-e7e92a7577fcaadd4d63483a41ab2a71d913c3d6.tar.gz
scummvm-rg350-e7e92a7577fcaadd4d63483a41ab2a71d913c3d6.tar.bz2
scummvm-rg350-e7e92a7577fcaadd4d63483a41ab2a71d913c3d6.zip
SCUMM: Fix bug #3143039 - ACTIVITY: Circus Stormin' crash.
svn-id: r55049
Diffstat (limited to 'engines/scumm/script_v6.cpp')
-rw-r--r--engines/scumm/script_v6.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 0226343df5..e0a6528670 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -381,15 +381,17 @@ ScummEngine_v6::ArrayHeader *ScummEngine_v6::getArray(int array) {
if (!ah)
return 0;
- // Workaround for a long standing bug where we saved array headers in native
- // endianness, instead of a fixed endianness. We now always store the
- // dimensions in little endian byte order. But to stay compatible with older
- // savegames, we try to detect savegames which were created on a big endian
- // system and convert them to the proper little endian format on the fly.
- if ((FROM_LE_16(ah->dim1) & 0xF000) || (FROM_LE_16(ah->dim2) & 0xF000) || (FROM_LE_16(ah->type) & 0xFF00)) {
- SWAP16(ah->dim1);
- SWAP16(ah->dim2);
- SWAP16(ah->type);
+ if (_game.heversion == 0) {
+ // Workaround for a long standing bug where we saved array headers in native
+ // endianness, instead of a fixed endianness. We now always store the
+ // dimensions in little endian byte order. But to stay compatible with older
+ // savegames, we try to detect savegames which were created on a big endian
+ // system and convert them to the proper little endian format on the fly.
+ if ((FROM_LE_16(ah->dim1) & 0xF000) || (FROM_LE_16(ah->dim2) & 0xF000) || (FROM_LE_16(ah->type) & 0xFF00)) {
+ SWAP16(ah->dim1);
+ SWAP16(ah->dim2);
+ SWAP16(ah->type);
+ }
}
return ah;