Menu: If an item depending on a cvar which is also controlled by another item gets...
authorterencehill <piuntn@gmail.com>
Thu, 30 Apr 2020 22:04:41 +0000 (00:04 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 30 Apr 2020 22:14:55 +0000 (00:14 +0200)
qcsrc/menu/xonotic/util.qc

index a126b9e..5e9fdb0 100644 (file)
@@ -127,6 +127,7 @@ void makeCallback(entity e, entity cbent, void(entity, entity) cbfunc)
 .bool disabled;
 void setDependent_Check(entity e)
 {
+       bool disabled_prev = e.disabled;
        float f;
        string s;
        if(e.func_setDependent)
@@ -165,6 +166,8 @@ void setDependent_Check(entity e)
                                e.disabled = (e.disabled + ((f >= e.cvar3Max_setDependent) && (f <= e.cvar3Min_setDependent)) > e.op_setDependent);
                }
        }
+       if (disabled_prev != e.disabled && e.loadCvars)
+               e.loadCvars(e);
 }
 void setDependent_Draw(entity e)
 {