From: havoc Date: Sun, 28 Jul 2013 00:11:33 +0000 (+0000) Subject: added FORCEGAME define for building an engine that runs a specific game X-Git-Tag: xonotic-v0.8.0~149 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=85ba4cfaf8b96912d7e5dfa467ad8d63baffc552;p=xonotic%2Fdarkplaces.git added FORCEGAME define for building an engine that runs a specific game regardless of executable name (this basically overrides the executable name check) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11988 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=6a744c951b1e31392689e43dc8a578f80fee2e49 --- diff --git a/common.c b/common.c index e981b779..00e924b6 100644 --- a/common.c +++ b/common.c @@ -1484,9 +1484,13 @@ void COM_InitGameType (void) int i; int index = 0; +#ifdef FORCEGAME + COM_ToLowerString(FORCEGAME, name, sizeof (name)); +#else // 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)); +#endif 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)) index = i;