From 71a1c0a27f71b4ac3de790e2490b24a757d1e795 Mon Sep 17 00:00:00 2001 From: athrxx Date: Sun, 21 Apr 2013 01:42:14 +0200 Subject: KYRA: (EOB) - fix bug #3611077 --- engines/kyra/darkmoon.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/kyra/darkmoon.cpp b/engines/kyra/darkmoon.cpp index 130fb10df3..a694a4aba5 100644 --- a/engines/kyra/darkmoon.cpp +++ b/engines/kyra/darkmoon.cpp @@ -243,6 +243,17 @@ void DarkMoonEngine::replaceMonster(int unit, uint16 block, int pos, int dir, in if (_monsters[i].flags & 0x40) continue; + // WORKAROUND for bug #3611077 (Dran's dragon transformation sequence triggered prematurely): + // The boss level and the mindflayer level share the same monster data. If you hang around + // long enough in the mindflayer level all 30 monster slots will be used up. When this + // happens it will trigger the dragon transformation sequence when Dran is moved around by script. + // We avoid removing Dran here by prefering monster slots occupied by monsters from another + // sub level. + if (_monsters[i].sub != _currentSub) { + index = i; + break; + } + int dist = getBlockDistance(_monsters[i].block, _currentBlock); if (dist > maxDist) { @@ -261,7 +272,10 @@ void DarkMoonEngine::replaceMonster(int unit, uint16 block, int pos, int dir, in } bool DarkMoonEngine::killMonsterExtra(EoBMonsterInPlay *m) { - if (_currentLevel == 16 && _currentSub == 1 && (_monsterProps[m->type].capsFlags & 4)) { + // WORKAROUND for bug #3611077 (see DarkMoonEngine::replaceMonster()) + // The mindflayers have monster type 0, just like Dran. Using a monster slot occupied by a mindflayer would trigger the dragon transformation + // sequence when all 30 monster slots are used up. We avoid this by checking for m->sub == 1. + if (_currentLevel == 16 && _currentSub == 1 && m->sub == 1 && (_monsterProps[m->type].capsFlags & 4)) { if (m->type) { _playFinale = true; _runFlag = false; -- cgit v1.2.3