aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorD G Turner2018-10-18 22:25:21 +0100
committerD G Turner2018-10-18 22:25:21 +0100
commit91732239991918b25633cd07d6c5ae834e599115 (patch)
treed1146a69216c7250ed924b230443dc3bbdc6b991 /engines
parentc7fc6bbc30f8b3e8732d5f13a3db9a779f80873a (diff)
downloadscummvm-rg350-91732239991918b25633cd07d6c5ae834e599115.tar.gz
scummvm-rg350-91732239991918b25633cd07d6c5ae834e599115.tar.bz2
scummvm-rg350-91732239991918b25633cd07d6c5ae834e599115.zip
SCI: Fix Segfault When Using Console "show_map" Command on SCI32 games.
The _gfxScreen instance is nullptr for SCI32 games, thus this console command previously caused a segfault.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/console.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 371ed7fc71..91c5d01e87 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2568,6 +2568,13 @@ bool Console::cmdShowMap(int argc, const char **argv) {
return true;
}
+#ifdef ENABLE_SCI32
+ if (getSciVersion() >= SCI_VERSION_2) {
+ debugPrintf("Command not available / implemented for SCI32 games.\n");
+ return true;
+ }
+#endif
+
int map = atoi(argv[1]);
switch (map) {
@@ -2575,7 +2582,9 @@ bool Console::cmdShowMap(int argc, const char **argv) {
case 1:
case 2:
case 3:
- _engine->_gfxScreen->debugShowMap(map);
+ if (_engine->_gfxScreen) {
+ _engine->_gfxScreen->debugShowMap(map);
+ }
break;
default: