aboutsummaryrefslogtreecommitdiff
path: root/engines/sky
diff options
context:
space:
mode:
authorlavosspawn2016-07-21 19:14:46 +0200
committerlavosspawn2016-07-21 19:14:46 +0200
commite40b4850f7ac94766c90873a9ac3e598f31bba40 (patch)
tree470a888ac5f5b2a67647e25e75c405bb45a57458 /engines/sky
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')
-rw-r--r--engines/sky/compact.cpp17
-rw-r--r--engines/sky/compact.h2
-rw-r--r--engines/sky/logic.cpp2
3 files changed, 20 insertions, 1 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));
diff --git a/engines/sky/compact.h b/engines/sky/compact.h
index 0bd5b4943b..86db0ba55b 100644
--- a/engines/sky/compact.h
+++ b/engines/sky/compact.h
@@ -78,6 +78,8 @@ public:
uint16 giveDataListLen(uint16 listNum);
const char *nameForType(uint16 type);
private:
+ void checkAndFixOfficerBluntError();
+
uint16 _numDataLists;
uint16 *_dataListLen;
uint16 *_rawBuf;
diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp
index e1175f9936..ad656ac8df 100644
--- a/engines/sky/logic.cpp
+++ b/engines/sky/logic.cpp
@@ -1717,7 +1717,7 @@ bool Logic::fnSpeakMe(uint32 targetId, uint32 mesgNum, uint32 animNum) {
on other screens, as the lack of speech files for these lines
will cause Foster's speech to be aborted if the timing is bad.
*/
- if (targetId == 0x4039 && animNum == 0x9B && Logic::_scriptVariables[SCREEN] != 38) {
+ if (targetId == ID_DANIELLE && animNum == 0x9B && Logic::_scriptVariables[SCREEN] != 38) {
return false;
}