From: Rudolf Polzer Date: Wed, 8 Sep 2010 15:55:36 +0000 (+0200) Subject: fix the team number slider, hopefully X-Git-Tag: xonotic-v0.1.0preview~315^2~12^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=985ebece18586eaa77bbb1f8afba502143b73b21;p=xonotic%2Fxonotic-data.pk3dir.git fix the team number slider, hopefully --- diff --git a/qcsrc/menu/xonotic/textslider.c b/qcsrc/menu/xonotic/textslider.c index 69270a67a..415e15274 100644 --- a/qcsrc/menu/xonotic/textslider.c +++ b/qcsrc/menu/xonotic/textslider.c @@ -61,6 +61,16 @@ void XonoticTextSlider_loadCvars(entity me) for(i = 1; i < n; ++i) s = strcat(s, " ", cvar_string(argv(i))); me.setValueFromIdentifier(me, s); + if(me.value < 0 && n > 1) + { + // if it failed: check if all cvars have the same value + // if yes, try its value as 1-word identifier + for(i = 1; i < n; ++i) + if(cvar_string(argv(i)) != cvar_string(argv(i-1))) + break; + if(i >= n) + me.setValueFromIdentifier(me, cvar_string(argv(0))); + } } void XonoticTextSlider_saveCvars(entity me) {