]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
add comments so I know which plane type is which
[xonotic/darkplaces.git] / cl_main.c
index dba40bc58353e709e8e68cf22ae3f9e1ebb605c5..be5497fe5cedf91adbcaf8b6b8c5e4aaef7d34ab 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -122,7 +122,7 @@ void CL_ClearState(void)
        cl.sensitivityscale = 1.0f;
 
        // enable rendering of the world and such
-       cl.csqc_vidvars.drawworld = r_drawworld.integer;
+       cl.csqc_vidvars.drawworld = r_drawworld.integer != 0;
        cl.csqc_vidvars.drawenginesbar = true;
        cl.csqc_vidvars.drawcrosshair = true;
 
@@ -171,7 +171,7 @@ void CL_ClearState(void)
                cl.entities[i].state_current = defaultstate;
        }
 
-       if (gamemode == GAME_NEXUIZ)
+       if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
        {
                VectorSet(cl.playerstandmins, -16, -16, -24);
                VectorSet(cl.playerstandmaxs, 16, 16, 45);
@@ -407,7 +407,7 @@ CL_EstablishConnection
 Host should be either "local" or a net address
 =====================
 */
-void CL_EstablishConnection(const char *host)
+void CL_EstablishConnection(const char *host, int firstarg)
 {
        if (cls.state == ca_dedicated)
                return;
@@ -434,7 +434,24 @@ void CL_EstablishConnection(const char *host)
                cls.connect_trying = true;
                cls.connect_remainingtries = 3;
                cls.connect_nextsendtime = 0;
+
+               // only NOW, set connect_userinfo
+               if(firstarg >= 0)
+               {
+                       int i;
+                       *cls.connect_userinfo = 0;
+                       for(i = firstarg; i+2 <= Cmd_Argc(); i += 2)
+                               InfoString_SetValue(cls.connect_userinfo, sizeof(cls.connect_userinfo), Cmd_Argv(i), Cmd_Argv(i+1));
+               }
+               else if(firstarg < -1)
+               {
+                       // -1: keep as is (reconnect)
+                       // -2: clear
+                       *cls.connect_userinfo = 0;
+               }
+
                M_Update_Return_Reason("Trying to connect...");
+
                // run several network frames to jump into the game quickly
                //if (sv.active)
                //{
@@ -1159,7 +1176,7 @@ void CL_UpdateNetworkEntityTrail(entity_t *e)
        {
                if (e->render.effects & EF_BRIGHTFIELD)
                {
-                       if (gamemode == GAME_NEXUIZ)
+                       if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
                                trailtype = EFFECT_TR_NEXUIZPLASMA;
                        else
                                CL_EntityParticles(e);
@@ -1378,7 +1395,7 @@ void CL_LinkNetworkEntity(entity_t *e)
        {
                if (e->render.effects & EF_BRIGHTFIELD)
                {
-                       if (gamemode == GAME_NEXUIZ)
+                       if (gamemode == GAME_NEXUIZ || gamemode == GAME_XONOTIC)
                                trailtype = EFFECT_TR_NEXUIZPLASMA;
                }
                if (e->render.effects & EF_DIMLIGHT)