aboutsummaryrefslogtreecommitdiff
path: root/engines/sky/compact.cpp
diff options
context:
space:
mode:
authorlavosspawn2016-07-21 19:14:46 +0200
committerlavosspawn2016-07-21 19:14:46 +0200
commite40b4850f7ac94766c90873a9ac3e598f31bba40 (patch)
tree470a888ac5f5b2a67647e25e75c405bb45a57458 /engines/sky/compact.cpp
parent7874f517f79da796e480e014d72f536d3abe2af8 (diff)
downloadscummvm-rg350-e40b4850f7ac94766c90873a9ac3e598f31bba40.tar.gz
scummvm-rg350-e40b4850f7ac94766c90873a9ac3e598f31bba40.tar.bz2
scummvm-rg350-e40b4850f7ac94766c90873a9ac3e598f31bba40.zip
Modified compact implementation to work around bug
https://sourceforge.net/p/scummvm/bugs/2687/ when playing Beneath a Steel Sky with our (slightly broken) sky.cpt
Diffstat (limited to 'engines/sky/compact.cpp')
-rw-r--r--engines/sky/compact.cpp17
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));