From 965cfe40086df3274e8228a526a624b96bfc5e03 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 21 Sep 2006 11:42:44 +0000 Subject: Fix bug #1562795: "Bug with auto-generated game IDs" svn-id: r23960 --- NEWS | 1 + gui/launcher.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index d33c1a8cdc..261fd3caf0 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,7 @@ For a more comprehensive changelog for the latest experimental SVN code, see: 0.9.1 (????-??-??) General: - Fixed potential garbage and/or crash in debug console. + - Removed restriction on 27 games per game id when added via launcher. SCUMM: - Improved support for international versions of HE games. diff --git a/gui/launcher.cpp b/gui/launcher.cpp index a41615668c..eadd2ab78c 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -649,13 +649,13 @@ void LauncherDialog::addGame() { // are *adding* a game to the config, not replacing). String domain(result.gameid); if (ConfMan.hasGameDomain(domain)) { - char suffix = 'a'; - domain += suffix; + int suffixN = 1; + char suffix[16]; + while (ConfMan.hasGameDomain(domain)) { - assert(suffix < 'z'); - domain.deleteLastChar(); - suffix++; - domain += suffix; + snprintf(suffix, 16, "-%d", suffixN); + domain = result.gameid + suffix; + suffixN++; } } -- cgit v1.2.3