SCI: QfG1/2/3/4 character file detection changed

No longer checking for .sav file suffix, but instead checking
room number instead. The user is able to change the suffix,
which would have resulted in a compressed character file.
This commit is contained in:
Martin Kiewitz 2016-02-05 18:40:14 +01:00
parent bdec938dd2
commit c61c89dd35

View File

@ -66,13 +66,29 @@ reg_t file_open(EngineState *s, const Common::String &filename, int mode, bool u
bool isCompressed = true;
const SciGameId gameId = g_sci->getGameId();
if ((gameId == GID_QFG1 || gameId == GID_QFG1VGA || gameId == GID_QFG2 || gameId == GID_QFG3)
&& englishName.hasSuffix(".sav")) {
// QFG Characters are saved via the CharSave object.
// We leave them uncompressed so that they can be imported in later QFG
// games.
// Rooms/Scripts: QFG1: 601, QFG2: 840, QFG3/4: 52
isCompressed = false;
// QFG Characters are saved via the CharSave object.
// We leave them uncompressed so that they can be imported in later QFG
// games, even when using the original interpreter.
// We check for room numbers in here, because the file suffix can be changed by the user.
// Rooms/Scripts: QFG1(EGA/VGA): 601, QFG2: 840, QFG3/4: 52
switch (gameId) {
case GID_QFG1:
case GID_QFG1VGA:
if (s->currentRoomNumber() == 601)
isCompressed = false;
break;
case GID_QFG2:
if (s->currentRoomNumber() == 840)
isCompressed = false;
break;
case GID_QFG3:
case GID_QFG4:
if (s->currentRoomNumber() == 52)
isCompressed = false;
break;
default:
break;
}
if (mode == _K_FILE_MODE_OPEN_OR_FAIL) {