diff options
author | Max Horn | 2002-08-26 16:13:38 +0000 |
---|---|---|
committer | Max Horn | 2002-08-26 16:13:38 +0000 |
commit | 39422bd24ad0e7a9ec40f28d23e5fc8c4402cbf4 (patch) | |
tree | 8cb0bef52af354f66ecc94d8fff1c1ad9c1f1095 | |
parent | bacdd936f2bb2259430fd6658ff3ef4a0ce57b91 (diff) | |
download | scummvm-rg350-39422bd24ad0e7a9ec40f28d23e5fc8c4402cbf4.tar.gz scummvm-rg350-39422bd24ad0e7a9ec40f28d23e5fc8c4402cbf4.tar.bz2 scummvm-rg350-39422bd24ad0e7a9ec40f28d23e5fc8c4402cbf4.zip |
fix endian issue for old savegames created on big endian system when trying to load them on little endian systems
svn-id: r4862
-rw-r--r-- | scumm/saveload.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 9e718f9f6e..383419a789 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -96,8 +96,10 @@ bool Scumm::loadState(int slot, bool compat) return false; } + // In older versions of ScummVM, the header version was not endian safe. + // We account for that by retrying once with swapped byte order. if (hdr.ver < VER_V7 || hdr.ver > _current_version) - hdr.ver = TO_LE_32(hdr.ver); + hdr.ver = SWAP_BYTES(hdr.ver); if (hdr.ver < VER_V7 || hdr.ver > _current_version) { warning("Invalid version of '%s'", filename); |