From 39422bd24ad0e7a9ec40f28d23e5fc8c4402cbf4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 26 Aug 2002 16:13:38 +0000 Subject: [PATCH] fix endian issue for old savegames created on big endian system when trying to load them on little endian systems svn-id: r4862 --- scumm/saveload.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 9e718f9f6e5..383419a7894 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);