From f889457d3d7952b97e1e6be5a70ad20ec832f6e5 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 15 Dec 2012 22:19:15 -0500 Subject: PEGASUS: Fix segfault when pressing 'i' during the space chase Thanks to digitall for finding this one --- engines/pegasus/pegasus.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/pegasus') 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) -- cgit v1.2.3