aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorathrxx2020-01-08 22:54:37 +0100
committerathrxx2020-01-08 23:14:34 +0100
commit40bf41bf309664f7945f92083b71a03d4604e631 (patch)
tree12a5acbe7bac34fb8546de74165d1ff3dbb4eddc
parent25dca26ff82caf5e944212bd39b128484211a830 (diff)
downloadscummvm-rg350-40bf41bf309664f7945f92083b71a03d4604e631.tar.gz
scummvm-rg350-40bf41bf309664f7945f92083b71a03d4604e631.tar.bz2
scummvm-rg350-40bf41bf309664f7945f92083b71a03d4604e631.zip
KYRA: (LOK) - workaround for green potion animation
The optional green potion that can be made at the alchemists' crystals can lead to invalid memory access. The animation frames aren't properly cleaned up like in the snake poisoning sequence. I just add the same handling as as workaround.
-rw-r--r--engines/kyra/script/script_lok.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/engines/kyra/script/script_lok.cpp b/engines/kyra/script/script_lok.cpp
index 325ee67c9e..2efa159f0b 100644
--- a/engines/kyra/script/script_lok.cpp
+++ b/engines/kyra/script/script_lok.cpp
@@ -362,6 +362,19 @@ int KyraEngine_LoK::o1_forceBrandonToNormal(EMCState *script) {
int KyraEngine_LoK::o1_poisonDeathNow(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_poisonDeathNow(%p) ()", (const void *)script);
seq_poisonDeathNow(1);
+
+ // WORKAROUND for the poison animation after drinking the green potion
+ // that can be made at the alchemists' crystals.
+ // The next animator update from inside delay() after completing the
+ // poison animation would cause invalid memory access (tryin to draw the
+ // already freed special anim shape 142).
+ // I can definitely confirm that for the FM-TOWNS version. I don't know
+ // about the DOS-CD version. Maybe this has been fixed there somehow.
+ // I simply repeat the same steps that are done after the potion animation
+ // when bitten by the snake (scene_lok.cpp, lines 964, 966).
+ _characterList[0].currentAnimFrame = 7;
+ _animator->animRefreshNPC(0);
+
return 0;
}