diff options
author | Travis Howell | 2010-12-27 14:02:17 +0000 |
---|---|---|
committer | Travis Howell | 2010-12-27 14:02:17 +0000 |
commit | e7e92a7577fcaadd4d63483a41ab2a71d913c3d6 (patch) | |
tree | 4d180744b7e3e0c95e9ee14a8b5f4cd949cfc050 | |
parent | 4f3623964465a6d42d99b0fa37ba9073e948c79f (diff) | |
download | scummvm-rg350-e7e92a7577fcaadd4d63483a41ab2a71d913c3d6.tar.gz scummvm-rg350-e7e92a7577fcaadd4d63483a41ab2a71d913c3d6.tar.bz2 scummvm-rg350-e7e92a7577fcaadd4d63483a41ab2a71d913c3d6.zip |
SCUMM: Fix bug #3143039 - ACTIVITY: Circus Stormin' crash.
svn-id: r55049
-rw-r--r-- | engines/scumm/script_v6.cpp | 20 |
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; |