diff options
Diffstat (limited to 'engines/sky/compact.cpp')
-rw-r--r-- | engines/sky/compact.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index ee165934a0..ce62dcb2ae 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -236,6 +236,8 @@ SkyCompact::SkyCompact() { for (cnt = 0; cnt < _numSaveIds; cnt++) _saveIds[cnt] = FROM_LE_16(_saveIds[cnt]); _resetDataPos = _cptFile->pos(); + + checkAndFixOfficerBluntError(); } SkyCompact::~SkyCompact() { @@ -257,6 +259,21 @@ SkyCompact::~SkyCompact() { delete _cptFile; } +/* WORKAROUND for bug #2687: + The first release of scummvm with externalized, binary compact data has one broken 16 bit reference. + When talking to Officer Blunt on ground level while in a crouched position, the game enters an + unfinishable state because Blunt jumps into the lake and can no longer be interacted with. + This fixes the problem when playing with a broken sky.cpt */ +#define SCUMMVM_BROKEN_TALK_INDEX 158 +void SkyCompact::checkAndFixOfficerBluntError() { + // Retrieve the table with the animation ids to use for talking + uint16 *talkTable = (uint16*)fetchCpt(CPT_TALK_TABLE_LIST); + if (talkTable[SCUMMVM_BROKEN_TALK_INDEX] == ID_SC31_GUARD_TALK) { + debug(1, "SKY.CPT with Officer Blunt bug encountered, fixing talk gfx."); + talkTable[SCUMMVM_BROKEN_TALK_INDEX] = ID_SC31_GUARD_TALK2; + } +} + // needed for some workaround where the engine has to check if it's currently processing joey, for example bool SkyCompact::cptIsId(Compact *cpt, uint16 id) { return (cpt == fetchCpt(id)); |