]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - lhnet.c
converted portal building over to use polygon functions instead of winding
[xonotic/darkplaces.git] / lhnet.c
diff --git a/lhnet.c b/lhnet.c
index 58033bac8fe18646028a5621af32c318a558a675..48a2c2c34bea3059849ea66f003d1e978b04da50 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -457,8 +457,10 @@ lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address)
                                        if (ioctl(lhnetsocket->inetsocket, FIONBIO, &_true) != -1)
 #endif
                                        {
-                                               if (bind(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4)) != -1)
+                                               size_t namelen = address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4);
+                                               if (bind(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, namelen) != -1)
                                                {
+                                                       getsockname(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, &namelen);
                                                        lhnetsocket->next = &lhnet_socketlist;
                                                        lhnetsocket->prev = lhnetsocket->next->prev;
                                                        lhnetsocket->next->prev = lhnetsocket;
@@ -672,8 +674,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.value || cl_fakelocalping_max.value)
-                       p->sentdoubletime = Sys_DoubleTime() + lhrandom(cl_fakelocalping_min.value, cl_fakelocalping_max.value) * (0.5 / 1000.0);
+               if (cl_netlocalping_min.value || cl_netlocalping_max.value)
+                       p->sentdoubletime = Sys_DoubleTime() + lhrandom(cl_netlocalping_min.value, cl_netlocalping_max.value) * (0.5 / 1000.0);
 #endif
                value = contentlength;
        }