diff options
author | Matthew Hoops | 2012-12-15 22:19:15 -0500 |
---|---|---|
committer | Matthew Hoops | 2012-12-15 22:19:15 -0500 |
commit | f889457d3d7952b97e1e6be5a70ad20ec832f6e5 (patch) | |
tree | 724a816129988b99c710a48b288715bc731c5963 /engines/pegasus/pegasus.cpp | |
parent | bf51a7e6a6e3987d8122c42109274f90db8dd2a1 (diff) | |
download | scummvm-rg350-f889457d3d7952b97e1e6be5a70ad20ec832f6e5.tar.gz scummvm-rg350-f889457d3d7952b97e1e6be5a70ad20ec832f6e5.tar.bz2 scummvm-rg350-f889457d3d7952b97e1e6be5a70ad20ec832f6e5.zip |
PEGASUS: Fix segfault when pressing 'i' during the space chase
Thanks to digitall for finding this one
Diffstat (limited to 'engines/pegasus/pegasus.cpp')
-rw-r--r-- | engines/pegasus/pegasus.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp index 502a79ec25..98f0553783 100644 --- a/engines/pegasus/pegasus.cpp +++ b/engines/pegasus/pegasus.cpp @@ -1428,6 +1428,10 @@ void PegasusEngine::switchGameMode(const GameMode newMode, const GameMode oldMod } bool PegasusEngine::canSwitchGameMode(const GameMode newMode, const GameMode oldMode) { + // WORKAROUND: Don't allow game mode switches when the interface is not set up. + // Prevents segfaults when pressing 'i' when in the space chase. + if (!g_interface) + return false; if (newMode == kModeInventoryPick && oldMode == kModeBiochipPick) return false; if (newMode == kModeBiochipPick && oldMode == kModeInventoryPick) |