Skip to content

Commit 10536e2

Browse files
committed
SCUMM: Fix bug #3306145: INDY3: EGA version script bugs
Based on a patch presented in the bugreport. Fixes several bugs connected with calcualting IQ points in Amiga versions of Indy3.
1 parent 648d127 commit 10536e2

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

engines/scumm/script_v4.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ 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) {
80+
b = 0;
81+
}
82+
7183
jumpRelative(getState(a) == b);
7284
}
7385

engines/scumm/script_v5.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,20 @@ 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]);
2108+
data[0] = 29;
2109+
data[1] = 10;
2110+
}
2111+
20982112
// Method used by original games to skip copy protection scheme
20992113
if (!_copyProtection) {
21002114
// Copy protection was disabled in LucasArts Classic Adventures (PC Disk)

0 commit comments

Comments
 (0)