me.TD(me, 1, 2, e = makeXonoticRadioButton(1, string_null, string_null, _("Regular (no arena)")));
me.TR(me);
me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_weaponarena", "menu_weaponarena", _("Weapon arenas:")));
- e.getCvarValueFromCvar = true;
+ e.cvarValueIsAnotherCvar = true;
e.cvarOffValue = "0";
for(i = WEP_FIRST, j = 0; i <= WEP_LAST; ++i)
{
ATTRIB(XonoticRadioButton, cvarName, string, string_null)
ATTRIB(XonoticRadioButton, cvarValue, string, string_null)
ATTRIB(XonoticRadioButton, cvarOffValue, string, string_null)
- ATTRIB(XonoticRadioButton, getCvarValueFromCvar, float, 0)
+ ATTRIB(XonoticRadioButton, cvarValueIsAnotherCvar, float, 0)
METHOD(XonoticRadioButton, loadCvars, void(entity));
METHOD(XonoticRadioButton, saveCvars, void(entity));
if(me.cvarValue)
{
if(me.cvarName)
- me.checked = (cvar_string(me.cvarName) == me.cvarValue);
+ {
+ if(me.cvarValueIsAnotherCvar)
+ me.checked = (cvar_string(me.cvarName) == cvar_string(me.cvarValue));
+ else
+ me.checked = (cvar_string(me.cvarName) == me.cvarValue);
+ }
}
else
{
{
if(me.checked)
{
- if(me.getCvarValueFromCvar)
+ if(me.cvarValueIsAnotherCvar)
cvar_set(me.cvarName, cvar_string(me.cvarValue));
else
cvar_set(me.cvarName, me.cvarValue);
void PlayerPostThink (void)
{
if(sv_maxidle > 0 && frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero).
+ if(IS_REAL_CLIENT(self))
if(IS_PLAYER(self) || sv_maxidle_spectatorsareidle)
{
if (time - self.parm_idlesince < 1) // instead of (time == self.parm_idlesince) to support sv_maxidle <= 10