]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
fix for two Con_Printf calls that are passed a string as the format string
[xonotic/darkplaces.git] / cl_parse.c
index cf626f3211e8594b1c3ea6560268f7e12a0ed302..f2c704f2b980c98c1b4a163fd6fadd6445c86ec5 100644 (file)
@@ -67,7 +67,7 @@ char *svc_strings[128] =
        "svc_cutscene",
        "svc_showlmp",  // [string] iconlabel [string] lmpfile [short] x [short] y
        "svc_hidelmp",  // [string] iconlabel
-       "", // 37
+       "svc_skybox", // [string] skyname
        "", // 38
        "", // 39
        "", // 40
@@ -88,7 +88,7 @@ char *svc_strings[128] =
 
 //=============================================================================
 
-cvar_t demo_nehahra = {"demo_nehahra", "0"};
+cvar_t demo_nehahra = {0, "demo_nehahra", "0"};
 
 void CL_Parse_Init(void)
 {
@@ -246,7 +246,7 @@ void CL_ParseEntityLump(char *entdata)
        char wadname[128];
        int i, j, k;
        FOG_clear(); // LordHavoc: no fog until set
-       skyname[0] = 0; // LordHavoc: no enviroment mapped sky until set
+       R_SetSkyBox(""); // LordHavoc: no environment mapped sky until set
        r_farclip.value = 6144; // LordHavoc: default farclip distance
        data = entdata;
        if (!data)
@@ -390,6 +390,8 @@ void CL_ParseServerInfo (void)
 // needlessly purge it
 //
 
+       Hunk_Check ();
+
 // precache models
        memset (cl.model_precache, 0, sizeof(cl.model_precache));
        for (nummodels=1 ; ; nummodels++)
@@ -406,6 +408,9 @@ void CL_ParseServerInfo (void)
                        Host_Error ("Server sent a precache name of %i characters (max %i)", strlen(str), MAX_QPATH - 1);
                strcpy (model_precache[nummodels], str);
                Mod_TouchModel (str);
+
+//             Hunk_Check ();
+
        }
 
 // precache sounds
@@ -430,10 +435,15 @@ void CL_ParseServerInfo (void)
 // now we try to load everything else until a cache allocation fails
 //
 
+       Hunk_Check ();
+
        for (i=1 ; i<nummodels ; i++)
        {
                isworldmodel = i == 1; // LordHavoc: first model is the world model
                cl.model_precache[i] = Mod_ForName (model_precache[i], false);
+
+//             Hunk_Check ();
+
                if (cl.model_precache[i] == NULL)
                {
                        Con_Printf("Model %s not found\n", model_precache[i]);
@@ -442,6 +452,8 @@ void CL_ParseServerInfo (void)
                CL_KeepaliveMessage ();
        }
 
+       Hunk_Check ();
+
        S_BeginPrecaching ();
        for (i=1 ; i<numsounds ; i++)
        {
@@ -453,12 +465,14 @@ void CL_ParseServerInfo (void)
 
 // local state
        cl_entities[0].render.model = cl.worldmodel = cl.model_precache[1];
-       
+
+//     Hunk_Check ();
+
        R_NewMap ();
 
        Hunk_Check ();          // make sure nothing is hurt
-       
-       noclip_anglehack = false;               // noclip is turned off at start        
+
+       noclip_anglehack = false;               // noclip is turned off at start
 }
 
 void CL_ValidateState(entity_state_t *s)
@@ -831,8 +845,6 @@ void CL_ParseStatic (int large)
        ent->render.alpha = 1;
        ent->render.scale = 1;
        ent->render.alpha = 1;
-       ent->render.glowsize = 0;
-       ent->render.glowcolor = 254;
        ent->render.colormod[0] = ent->render.colormod[1] = ent->render.colormod[2] = 1;
 
        VectorCopy (ent->state_baseline.origin, ent->render.origin);
@@ -980,7 +992,7 @@ void CL_ParseServerMessage (void)
                                        i &= 31;
                                }
                                description[strlen(description)-1] = '\n'; // replace the last space with a newline
-                               Con_Printf(description);
+                               Con_Printf("%s", description);
                                Host_Error ("CL_ParseServerMessage: Illegible server message\n");
                        }
                        break;
@@ -1198,6 +1210,9 @@ void CL_ParseServerMessage (void)
                case svc_showlmp:
                        SHOWLMP_decodeshow();
                        break;
+               case svc_skybox:
+                       R_SetSkyBox(MSG_ReadString());
+                       break;
                }
        }