mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-22 18:02:05 +00:00
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.
This commit is contained in:
parent
c7fc6bbc30
commit
9173223999
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user