]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/defs.qh
Limit sendcvar calls to one per frame
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / defs.qh
index 23760d74e1fffdf5e89839db0606d53fc56a53de..c8ed213c98557d74aa325801608efc625750db21 100644 (file)
@@ -175,10 +175,12 @@ REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9");
 .int cvar_value;
 void ReplicateVars(bool would_destroy)
 {
-       FOREACH(Notifications, it.nent_type == MSG_CHOICE, {
-               string cvarname = sprintf("notification_%s", Get_Notif_CvarName(it));
-               REPLICATE_SIMPLE(it.cvar_value, cvarname);
-       });
+       if (!would_destroy)
+               FOREACH(Notifications, it.nent_type == MSG_CHOICE, {
+                       string cvarname = sprintf("notification_%s", Get_Notif_CvarName(it));
+                       // NOTE: REPLICATE_SIMPLE can return;
+                       REPLICATE_SIMPLE(it.cvar_value, cvarname);
+               });
 }
 
 float bgmtime;