]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.c
added FORCEGAME define for building an engine that runs a specific game
[xonotic/darkplaces.git] / common.c
index e981b779a0796f18594857007a2794d0ee6041e3..00e924b64b47866b40b6e3f16fae94a08ee64b92 100644 (file)
--- 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;