Second part of Developer_searchpath() removal.

This was forgotten in the first commit. :(
This commit is contained in:
Yamagi Burmeister 2017-08-07 18:10:32 +02:00
parent 11b3a0515a
commit 7f46d808d2

View file

@ -79,6 +79,19 @@ typedef struct
menulayer_t m_layers[MAX_MENU_DEPTH];
int m_menudepth;
static qboolean
M_IsGame(const char *gamename)
{
cvar_t *game = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
if (strcmp(game->string, gamename) == 0)
{
return true;
}
return false;
}
static void
M_Banner(char *name)
{
@ -1917,15 +1930,12 @@ M_Credits_Key(int key)
return menu_out_sound;
}
extern int Developer_searchpath(void);
static void
M_Menu_Credits_f(void)
{
int n;
int count;
char *p;
int isdeveloper = 0;
creditsBuffer = NULL;
count = FS_LoadFile("credits", (void **)&creditsBuffer);
@ -1971,14 +1981,12 @@ M_Menu_Credits_f(void)
}
else
{
isdeveloper = Developer_searchpath();
if (isdeveloper == 1) /* Xatrix - The Reckoning */
if (M_IsGame("xatrix")) /* Xatrix - The Reckoning */
{
credits = xatcredits;
}
else if (isdeveloper == 2) /* Rogue - Ground Zero */
else if (M_IsGame("rogue")) /* Rogue - Ground Zero */
{
credits = roguecredits;
}
@ -2611,8 +2619,8 @@ JoinServer_MenuInit(void)
s_joinserver_server_title.generic.type = MTYPE_SEPARATOR;
s_joinserver_server_title.generic.name = "connect to...";
s_joinserver_server_title.generic.x = 80 * scale;
s_joinserver_server_title.generic.y = 30;
s_joinserver_server_title.generic.y = 30;
s_joinserver_server_title.generic.x = 80 * scale;
for (i = 0; i < MAX_LOCAL_SERVERS; i++)
{
@ -2700,7 +2708,7 @@ RulesChangeFunc(void *self)
}
/* Ground Zero game modes */
else if (Developer_searchpath() == 2)
else if (M_IsGame("rogue"))
{
if (s_rules_box.curvalue == 2)
{
@ -2730,7 +2738,7 @@ StartServerActionFunc(void *self)
Cvar_SetValue("fraglimit", ClampCvar(0, fraglimit, fraglimit));
Cvar_Set("hostname", s_hostname_field.buffer);
if ((s_rules_box.curvalue < 2) || (Developer_searchpath() != 2))
if ((s_rules_box.curvalue < 2) || M_IsGame("rogue"))
{
Cvar_SetValue("deathmatch", (float)!s_rules_box.curvalue);
Cvar_SetValue("coop", (float)s_rules_box.curvalue);
@ -2900,7 +2908,7 @@ StartServer_MenuInit(void)
s_rules_box.generic.name = "rules";
/* Ground Zero games only available with rogue game */
if (Developer_searchpath() == 2)
if (M_IsGame("rogue"))
{
s_rules_box.itemnames = dm_coop_names_rogue;
}
@ -3183,7 +3191,7 @@ DMFlagCallback(void *self)
{
bit = DF_QUAD_DROP;
}
else if (Developer_searchpath() == 2)
else if (M_IsGame("rogue"))
{
if (f == &s_no_mines_box)
{
@ -3359,7 +3367,7 @@ DMOptions_MenuInit(void)
s_friendlyfire_box.itemnames = yes_no_names;
s_friendlyfire_box.curvalue = (dmflags & DF_NO_FRIENDLY_FIRE) == 0;
if (Developer_searchpath() == 2)
if (M_IsGame("rogue"))
{
s_no_mines_box.generic.type = MTYPE_SPINCONTROL;
s_no_mines_box.generic.x = 0;
@ -3410,7 +3418,7 @@ DMOptions_MenuInit(void)
Menu_AddItem(&s_dmoptions_menu, &s_quad_drop_box);
Menu_AddItem(&s_dmoptions_menu, &s_friendlyfire_box);
if (Developer_searchpath() == 2)
if (M_IsGame("rogueg"))
{
Menu_AddItem(&s_dmoptions_menu, &s_no_mines_box);
Menu_AddItem(&s_dmoptions_menu, &s_no_nukes_box);