aboutsummaryrefslogtreecommitdiff
path: root/engines/sky
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sky')
-rw-r--r--engines/sky/compact.cpp2
-rw-r--r--engines/sky/compact.h2
-rw-r--r--engines/sky/debug.cpp12
-rw-r--r--engines/sky/disk.cpp4
-rw-r--r--engines/sky/logic.cpp11
-rw-r--r--engines/sky/sound.cpp2
6 files changed, 22 insertions, 11 deletions
diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp
index 84609d5500..fd81cb9bea 100644
--- a/engines/sky/compact.cpp
+++ b/engines/sky/compact.cpp
@@ -471,7 +471,7 @@ uint16 SkyCompact::giveDataListLen(uint16 listNum) {
return _dataListLen[listNum];
}
-const char *SkyCompact::_typeNames[NUM_CPT_TYPES] = {
+const char *const SkyCompact::_typeNames[NUM_CPT_TYPES] = {
"null",
"COMPACT",
"TURNTABLE",
diff --git a/engines/sky/compact.h b/engines/sky/compact.h
index a7b8520539..0bd5b4943b 100644
--- a/engines/sky/compact.h
+++ b/engines/sky/compact.h
@@ -88,7 +88,7 @@ private:
uint16 **_cptTypes;
Common::File *_cptFile;
uint32 _resetDataPos;
- static const char *_typeNames[NUM_CPT_TYPES];
+ static const char *const _typeNames[NUM_CPT_TYPES];
};
} // End of namespace Sky
diff --git a/engines/sky/debug.cpp b/engines/sky/debug.cpp
index ebc1ee377d..a417bc2ece 100644
--- a/engines/sky/debug.cpp
+++ b/engines/sky/debug.cpp
@@ -35,7 +35,7 @@
namespace Sky {
-static const char *logic_table_names[] = {
+static const char *const logic_table_names[] = {
"return",
"Logic::script",
"Logic::auto_route",
@@ -79,7 +79,7 @@ static const char opcode_par[] = {
0
};
-static const char *opcodes[] = {
+static const char *const opcodes[] = {
"push_variable",
"less_than",
"push_number",
@@ -103,7 +103,7 @@ static const char *opcodes[] = {
"restart_script"
};
-static const char *mcodes[] = {
+static const char *const mcodes[] = {
"fn_cache_chip",
"fn_cache_fast",
"fn_draw_screen",
@@ -221,7 +221,7 @@ static const char *mcodes[] = {
"fn_printf"
};
-static const char *scriptVars[] = {
+static const char *const scriptVars[] = {
"result",
"screen",
"logic_list_no",
@@ -1121,12 +1121,12 @@ bool Debugger::Cmd_ReloadGrid(int argc, const char **argv) {
return true;
}
-static const char *logicTypes[] = {
+static const char *const logicTypes[] = {
"(none)", "SCRIPT", "AUTOROUTE", "AR_ANIM", "AR_TURNING", "ALT", "MOD_ANIM", "TURNING", "CURSOR", "TALK", "LISTEN",
"STOPPED", "CHOOSE", "FRAMES", "PAUSE", "WAIT_SYNC", "SIMPLE MOD"
};
-static const char *noYes[] = { "no", "yes" };
+static const char *const noYes[] = { "no", "yes" };
void Debugger::dumpCompact(uint16 cptId) {
uint16 type, size;
diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp
index a06c5c9be8..99b707dcf1 100644
--- a/engines/sky/disk.cpp
+++ b/engines/sky/disk.cpp
@@ -32,8 +32,8 @@
namespace Sky {
-static const char *dataFilename = "sky.dsk";
-static const char *dinnerFilename = "sky.dnr";
+static const char *const dataFilename = "sky.dsk";
+static const char *const dinnerFilename = "sky.dnr";
Disk::Disk() {
_dataDiskHandle = new Common::File();
diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp
index 616670b0fd..a69ba793f2 100644
--- a/engines/sky/logic.cpp
+++ b/engines/sky/logic.cpp
@@ -1248,6 +1248,17 @@ script:
debug(3, "Doing Script: %d:%d:%x", moduleNo, scriptNo & 0xFFF, offset ? (offset - moduleStart[scriptNo & 0xFFF]) : 0);
+ // WORKAROUND for bug #3149412: "Invalid Mode when giving shades to travel agent"
+ // Using the dark glasses on Trevor (travel agent) multiple times in succession would
+ // wreck the trevor compact's mode, as the script in question doesn't account for using
+ // this item at this point in the game (you will only have it here if you play the game
+ // in an unusual way) and thus would loop indefinitely / never drop out.
+ // To prevent this, we trigger the generic response by pretending we're using an item
+ // which the script /does/ handle.
+ if (scriptNo == TREVOR_SPEECH && _scriptVariables[OBJECT_HELD] == IDO_SHADES)
+ _scriptVariables[OBJECT_HELD] = IDO_GLASS;
+
+
// Check whether we have an offset or what
if (offset)
scriptData = moduleStart + offset;
diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp
index e94a2a61d9..a60e3d9e38 100644
--- a/engines/sky/sound.cpp
+++ b/engines/sky/sound.cpp
@@ -872,7 +872,7 @@ static const Sfx fx_orifice_swallow_drip = {
}
};
-static const Sfx *musicList[] = {
+static const Sfx *const musicList[] = {
&fx_press_bang, // 256 banging of the press
&fx_press_hiss, // 257 hissing press
&fx_wind_howl, // 258 howling wind