]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 a126b9e5da2713f68fc1cf4f952950a035aadec8..5e9fdb03d96d9a0ab079810d52fe799fdbf41625 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)
 {