From: Rudolf Polzer Date: Thu, 9 Feb 2012 14:29:15 +0000 (+0100) Subject: make sure prvm_language is always set (turn empty string into "en") X-Git-Tag: xonotic-v0.6.0~74^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2b6ba568d2e2b6a1dd6af1b15b73892ccccc235a;p=xonotic%2Fxonotic-data.pk3dir.git make sure prvm_language is always set (turn empty string into "en") --- diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index e80247338..9f9d30fc4 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -29,7 +29,13 @@ void m_sync() void m_init() { cvar_set("_menu_alpha", "0"); - prvm_language = strzone(cvar_string("prvm_language")); + prvm_language = cvar_string("prvm_language"); + if(prvm_language == "") + { + prvm_language = "en"; + cvar_set("prvm_language", prvm_language); + } + prvm_language = strzone(prvm_language); cvar_set("_menu_prvm_language", prvm_language); check_unacceptable_compiler_bugs(); diff --git a/qcsrc/menu/xonotic/dialog_firstrun.c b/qcsrc/menu/xonotic/dialog_firstrun.c index 67b886ec9..d52c4c7b4 100644 --- a/qcsrc/menu/xonotic/dialog_firstrun.c +++ b/qcsrc/menu/xonotic/dialog_firstrun.c @@ -20,7 +20,7 @@ float CheckFirstRunButton(entity me) if(cvar_string("_cl_name") != "Player") return 1; - if(cvar_string("prvm_language") != prvm_language) + if(cvar_string("_menu_prvm_language") != prvm_language) return 1; // OK will then reopen the dialog in another language if(cvar_string("cl_allow_uid2name") != "-1") diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index ab86bebae..580f22a93 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -31,7 +31,7 @@ string getZonedTooltipForIdentifier(string s) if(t != "") return strzone(t); } - if(prvm_language == "en" || prvm_language == "") + if(prvm_language == "en") { t = cvar_description(s); if(t != "" && t != "custom cvar")