]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - lhnet.c
cl_fakelocalping cvars now produce the specified ping time (rather than twice it...
[xonotic/darkplaces.git] / lhnet.c
diff --git a/lhnet.c b/lhnet.c
index 998c7b08686c43fd5e65fcea977b1a2511347e00..50dc06f366ec158190cabcbb67179b46b9f3cef1 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -672,8 +672,8 @@ int LHNET_Write(lhnetsocket_t *lhnetsocket, const void *content, int contentleng
                p->next->prev = p;
                p->prev->next = p;
 #ifndef STANDALONETEST
-               if (cl_fakelocalping_min.integer || cl_fakelocalping_max.integer)
-                       p->sentdoubletime = Sys_DoubleTime() + (cl_fakelocalping_min.integer + ((cl_fakelocalping_max.integer - cl_fakelocalping_min.integer) * (rand() & 255) / 256)) / 1000.0;
+               if (cl_fakelocalping_min.value || cl_fakelocalping_max.value)
+                       p->sentdoubletime = Sys_DoubleTime() + lhrandom(cl_fakelocalping_min.value, cl_fakelocalping_max.value) * (0.5 / 1000.0);
 #endif
                value = contentlength;
        }