]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
host, netconn: Use cvar callbacks on (cl_)port to reduce branching in main loop
[xonotic/darkplaces.git] / cl_main.c
index d9256f16917dc859b178a7e8ce71cbd4c67ef71b..7ecf1bf800c53e0d1beb286d4d84f3e038b28502 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -428,6 +428,8 @@ void CL_Disconnect(void)
        cls.demoplayback = cls.timedemo = host.restless = false;
        cls.signon = 0;
 
+       Cvar_Callback(&cl_netport);
+
        // If we're dropped mid-connection attempt, it won't clear otherwise.
        SCR_ClearLoadingScreen(false);
 }
@@ -3084,6 +3086,8 @@ void CL_Init (void)
 
                CL_Video_Init();
 
+               NetConn_UpdateSockets_Client();
+
                host.hook.ConnectLocal = CL_EstablishConnection_Local;
                host.hook.Disconnect = CL_Disconnect;
                host.hook.CL_Intermission = CL_Intermission;