aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/script_v2.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index a0b64c090c..5eae8ebc77 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -444,7 +444,17 @@ int ScummEngine_v2::readVar(uint var) {
void ScummEngine_v2::writeVar(uint var, int value) {
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)");
debug(6, "writeVar(%d) = %d", var, value);
+
_scummVars[var] = value;
+
+ // HACK: Ender's hack around a bug in Maniac. If you take the last dime from
+ // Weird Ed's piggybank, this disables the New Kid option and runs the Jail
+ // cutscene. Script 116 sets var[175] to 1, which disables New Kid in
+ // script 164. Unfortunatly, when New Kid is reenabled (var[175] = 0) in
+ // script 89, script 164 isn't reran to redraw it. Why? Dunno. Hack? Yes.
+ if ((var == 175) && (_gameId == GID_MANIAC) && (vm.slot[_currentScript].number == 89))
+ runScript(164, 0, 0, 0);
+
}
void ScummEngine_v2::getResultPosIndirect() {