From 26a5c1c3a5ea76a92ebe60f074c3fbfa64a06fa7 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 19 Dec 2009 02:12:17 +0000 Subject: Fix segfault when quitting. static const Common::String's shouldn't be used. svn-id: r46416 --- engines/sci/engine/game.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 31f001aa05..848e6c5bf7 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -43,10 +43,10 @@ namespace Sci { struct OldNewIdTableEntry { - Common::String oldId; - Common::String newId; + const char *oldId; + const char *newId; bool demo; - Common::String demoCheckFile; // if not empty and it doesn't exist, the demo flag is set + const char *demoCheckFile; // if not empty and it doesn't exist, the demo flag is set }; static const OldNewIdTableEntry s_oldNewTable[] = { @@ -101,14 +101,14 @@ const char *convertSierraGameId(const char *gameName, uint32 *gameFlags) { // TODO: SCI32 IDs - for (const OldNewIdTableEntry *cur = s_oldNewTable; !cur->oldId.empty(); ++cur) { + for (const OldNewIdTableEntry *cur = s_oldNewTable; cur->oldId[0]; ++cur) { if (sierraId == cur->oldId) { if (cur->demo) *gameFlags |= ADGF_DEMO; - if (!cur->demoCheckFile.empty()) - if (!Common::File::exists(cur->demoCheckFile.c_str())) + if (cur->demoCheckFile[0]) + if (!Common::File::exists(cur->demoCheckFile)) *gameFlags |= ADGF_DEMO; - return cur->newId.c_str(); + return cur->newId; } } -- cgit v1.2.3