Ticket #5709: indy3-iq-fixes-v2.patch

File indy3-iq-fixes-v2.patch, 2.2 KB (added by BenCastricum, 13 years ago)

New patch, tested and found working.

  • engines/scumm/script_v4.cpp

    diff --git a/engines/scumm/script_v4.cpp b/engines/scumm/script_v4.cpp
    index 1302c8c..6d54456 100644
    a b void ScummEngine_v4::o4_ifState() {  
    6868        int a = getVarOrDirectWord(PARAM_1);
    6969        int b = getVarOrDirectByte(PARAM_2);
    7070
     71        // WORKAROUND bug #3306145 (also occurs in original): Some old versions of
     72        // Indy3 sometimes fail to allocate IQ points correctly. To quote:
     73        // "About the points error leaving Castle Brunwald: It seems to "reversed"!
     74        // When you get caught, free yourself and escape, you get 25 IQ points even
     75        // though you're not supposed to. However if you escape WITHOUT getting
     76        // caught, you get 0 IQ points (supposed to get 25 IQ points)."
     77        // This workaround is meant to address that.
     78        if (_game.id == GID_INDY3 && a == 367 &&
     79            vm.slot[_currentScript].number == 363 && _currentRoom == 25) {
     80debug("Workaround A active (b=%d)", b);
     81                b = 0;
     82        }
     83
    7184        jumpRelative(getState(a) == b);
    7285}
    7386
  • engines/scumm/script_v5.cpp

    diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
    index a6cf504..a882f4f 100644
    a b void ScummEngine_v5::o5_startScript() {  
    20952095        if (_game.id == GID_ZAK && _game.platform == Common::kPlatformFMTowns && script == 171)
    20962096                return;
    20972097
     2098        // WORKAROUND bug #3306145 (also occurs in original): Some old versions of
     2099        // Indy3 sometimes fail to allocate IQ points correctly. To quote:
     2100        // "In the Amiga version you get the 15 points for puzzle 30 if you give the
     2101        // book or KO the guy. The PC version correctly gives 10 points for puzzle
     2102        // 29 for KO and 15 for puzzle 30 when giving the book."
     2103        // This workaround is meant to address that.
     2104        if (_game.id == GID_INDY3 && vm.slot[_currentScript].number == 106 && script == 125 && VAR(115) != 2) {
     2105                // If Var[115] != 2, then:
     2106                // Correct: startScript(125,[29,10]);
     2107                // Wrong : startScript(125,[30,15]);
     2108debug("Workaround B active (%d,%d)", data[0], data[1]);
     2109                data[0] = 29;
     2110                data[1] = 10;
     2111        }
     2112
    20982113        // Method used by original games to skip copy protection scheme
    20992114        if (!_copyProtection) {
    21002115                // Copy protection was disabled in LucasArts Classic Adventures (PC Disk)