]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/replicate.qh
Merge branch 'bones_was_here/BoxTouchesBrush' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / replicate.qh
index a7a8d10df7fa4e06be5021bff35384a2330929a6..675d743c1892826940c6a8cb6b5b5924629289ce 100644 (file)
@@ -45,10 +45,18 @@ const int REPLICATEVARS_DESTROY = 1; // destroy data associated with cvars (shut
        noref float ReplicateVars_time;
        ACCUMULATE void ReplicateVars(int mode)
        {
-               if (time < ReplicateVars_time)
+               if (!ReplicateVars_time || time < ReplicateVars_time)
                        return;
                ReplicateVars_time = time + 0.8 + random() * 0.4; // check cvars periodically
        }
+       void ReplicateVars_Start()
+       {
+               if (!ReplicateVars_time) // make sure it gets executed only once
+               {
+                       ReplicateVars_time = time;
+                       ReplicateVars(REPLICATEVARS_SEND_ALL);
+               }
+       }
        #endif
 
        #define REPLICATE_3(fld, type, var) REPLICATE_4(fld, type, var, )