From abbf2bf16214eddf1394e62ae052d8505cba4d3b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 4 Dec 2009 14:25:31 +0000 Subject: Fix bug 2908376: FOA: Won't launch in Win32 svn-id: r46250 --- engines/scumm/script_v5.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index b86eb2b476..8091517c3f 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -1753,6 +1753,12 @@ void ScummEngine_v5::o5_roomOps() { case 13: // SO_SAVE_STRING { + // This subopcode is used in Indy 4 to save the IQ points data. + // No other game uses it. We use this to replace the given filename by + // one based on the targetname ("TARGET.iq"). + // This way, the iq data of each Indy 4 variant a user might have stays + // separate. Moreover, the filename now clearly reflects to which target + // it belongs (as it should). Common::String filename; char chr; @@ -1760,7 +1766,7 @@ void ScummEngine_v5::o5_roomOps() { while ((chr = fetchScriptByte())) filename += chr; - if (filename.hasPrefix("iq-") || filename.hasPrefix("IQ-") || filename.hasSuffix("-iq") || filename.hasSuffix("-IQ")) { + if (_game.id == GID_INDY4) { filename = _targetName + ".iq"; } else { error("SO_SAVE_STRING: Unsupported filename %s", filename.c_str()); @@ -1778,6 +1784,8 @@ void ScummEngine_v5::o5_roomOps() { } case 14: // SO_LOAD_STRING { + // This subopcode is used in Indy 4 to load the IQ points data. + // See SO_SAVE_STRING for details Common::String filename; char chr; @@ -1785,7 +1793,7 @@ void ScummEngine_v5::o5_roomOps() { while ((chr = fetchScriptByte())) filename += chr; - if (filename.hasPrefix("iq-") || filename.hasPrefix("IQ-") || filename.hasSuffix("-iq") || filename.hasSuffix("-IQ")) { + if (_game.id == GID_INDY4) { filename = _targetName + ".iq"; } else { error("SO_LOAD_STRING: Unsupported filename %s", filename.c_str()); -- cgit v1.2.3