From 5ed7a304a7fe83c1812d67dd0771501e01f5c950 Mon Sep 17 00:00:00 2001 From: Christian Ratzenhofer Date: Fri, 4 May 2012 00:18:30 +0200 Subject: [PATCH] Properly name game configuration files, fixes #43 and other issues related to stringcompares against config filename --- radiant/preferences.cpp | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 430c751f..7759ed5f 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -3411,8 +3411,40 @@ void CGameInstall::Run() { if(CheckFile(gameFilePath) != PATH_DIRECTORY) { radCreateDirectory(gameFilePath); } - gameFilePath += m_strName.GetBuffer(); - gameFilePath += ".game"; + + switch ( m_availGame[ m_nComboSelect ] ) { + case GAME_Q2: + gameFilePath += "q2.game"; + break; + case GAME_Q3: + gameFilePath += "q3.game"; + break; + case GAME_URT: + gameFilePath += "urt.game"; + break; + case GAME_UFOAI: + gameFilePath += "ufoai.game"; + break; + case GAME_Q2W: + gameFilePath += "q2w.game"; + break; + case GAME_WARSOW: + gameFilePath += "warsow.game"; + break; + case GAME_NEXUIZ: + gameFilePath += "nexuiz.game"; + break; + case GAME_TREMULOUS: + gameFilePath += "tremulous.game"; + break; + case GAME_JA: + gameFilePath += "ja.game"; + break; + case GAME_REACTION: + gameFilePath += "reaction.game"; + break; + } + Sys_Printf( "game file: %s\n", gameFilePath.GetBuffer() ); FILE * fg = fopen( gameFilePath.GetBuffer(), "w" ); -- 2.39.2