From 1a309ba9ce1d66060c46fe04d25f10e5984c4c1a Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 14 Sep 2011 00:42:26 +0000 Subject: [PATCH] changed executable name detection to ignore path changed GAME_SONOFMAN name detection to use sonofman instead of som as this was causing game detection bugs git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11348 d7cf8633-e32d-0410-b094-e92efae38249 --- common.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common.c b/common.c index d939a020..206cc057 100644 --- a/common.c +++ b/common.c @@ -1453,7 +1453,7 @@ static const gamemode_info_t gamemode_info [GAME_COUNT] = { GAME_BATTLEMECH, GAME_BATTLEMECH, "battlemech", "-battlemech", "Battlemech", "base", NULL, "battlemech", "battlemech" }, // COMMANDLINEOPTION: Game: -battlemech runs the multiplayer topdown deathmatch game BattleMech { GAME_ZYMOTIC, GAME_ZYMOTIC, "zymotic", "-zymotic", "Zymotic", "basezym", NULL, "zymotic", "zymotic" }, // COMMANDLINEOPTION: Game: -zymotic runs the singleplayer game Zymotic { GAME_SETHERAL, GAME_SETHERAL, "setheral", "-setheral", "Setheral", "data", NULL, "setheral", "setheral" }, // COMMANDLINEOPTION: Game: -setheral runs the multiplayer game Setheral -{ GAME_SOM, GAME_NORMAL, "som", "-som", "Son of Man", "id1", "sonofman", "som", "darkplaces" }, // COMMANDLINEOPTION: Game: -som runs the multiplayer game Son Of Man +{ GAME_SOM, GAME_NORMAL, "sonofman", "-som", "Son of Man", "id1", "sonofman", "som", "darkplaces" }, // COMMANDLINEOPTION: Game: -som runs the multiplayer game Son Of Man { GAME_TENEBRAE, GAME_NORMAL, "tenebrae", "-tenebrae", "DarkPlaces-Tenebrae", "id1", "tenebrae", "dp", "darkplaces" }, // COMMANDLINEOPTION: Game: -tenebrae runs the graphics test mod known as Tenebrae (some features not implemented) { GAME_NEOTERIC, GAME_NORMAL, "neoteric", "-neoteric", "Neoteric", "id1", "neobase", "neo", "darkplaces" }, // COMMANDLINEOPTION: Game: -neoteric runs the game Neoteric { GAME_OPENQUARTZ, GAME_NORMAL, "openquartz", "-openquartz", "OpenQuartz", "id1", NULL, "openquartz", "darkplaces" }, // COMMANDLINEOPTION: Game: -openquartz runs the game OpenQuartz, a standalone GPL replacement of the quake content @@ -1478,10 +1478,9 @@ void COM_InitGameType (void) int i; int index = 0; - FS_StripExtension (com_argv[0], name, sizeof (name)); - COM_ToLowerString (name, name, sizeof (name)); - - // check executable filename for keywords + // check executable filename for keywords, but do it SMARTLY - only check the last path element + FS_StripExtension(FS_FileWithoutPath(com_argv[0]), name, sizeof (name)); + COM_ToLowerString(name, name, sizeof (name)); for (i = 1;i < (int)(sizeof (gamemode_info) / sizeof (gamemode_info[0]));i++) if (gamemode_info[i].prog_name && gamemode_info[i].prog_name[0] && strstr (name, gamemode_info[i].prog_name)) { -- 2.39.2