From e15f8b4c745e7218dca6f115d27a640dfba4c9aa Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 27 Dec 2014 22:30:39 +0100 Subject: [PATCH] Simplify sliderTeams update code --- qcsrc/menu/xonotic/dialog_multiplayer_create.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create.c b/qcsrc/menu/xonotic/dialog_multiplayer_create.c index 1e06d98fc..bbffb5276 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create.c @@ -190,18 +190,17 @@ void XonoticServerCreateTab_gameTypeChangeNotify(entity me) default: GameType_ConfigureSliders(e, l, _("Frag limit:"), 5, 100, 5, "fraglimit_override"); break; } - float x = FALSE; + string x = string_null; e = me.sliderTeams; switch(gt) { - case MAPINFO_TYPE_CA: x = TRUE; e.configureXonoticTextSlider(e, "g_ca_teams_override"); break; - case MAPINFO_TYPE_DOMINATION: x = TRUE; e.configureXonoticTextSlider(e, "g_domination_teams_override"); break; - case MAPINFO_TYPE_FREEZETAG: x = TRUE; e.configureXonoticTextSlider(e, "g_freezetag_teams_override"); break; - case MAPINFO_TYPE_KEYHUNT: x = TRUE; e.configureXonoticTextSlider(e, "g_keyhunt_teams_override"); break; - case MAPINFO_TYPE_TEAM_DEATHMATCH: x = TRUE; e.configureXonoticTextSlider(e, "g_tdm_teams_override"); break; - - default: x = FALSE; e.configureXonoticTextSlider(e, string_null); break; + case MAPINFO_TYPE_CA: x = "g_ca_teams_override"; break; + case MAPINFO_TYPE_DOMINATION: x = "g_domination_teams_override"; break; + case MAPINFO_TYPE_FREEZETAG: x = "g_freezetag_teams_override"; break; + case MAPINFO_TYPE_KEYHUNT: x = "g_keyhunt_teams_override"; break; + case MAPINFO_TYPE_TEAM_DEATHMATCH: x = "g_tdm_teams_override"; break; } + e.configureXonoticTextSlider(e, x); e.configureXonoticTextSliderValues(e); if(!x) e.value = 0; -- 2.39.2