]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
fix a terrible mistake: don't send \n at the end of the client variables during signon
[xonotic/darkplaces.git] / cl_parse.c
index 245e094f0c62c4a459d5c3cd6340a84788fc492a..7f07b81da18373d6b72014e43ca82518f7bab90c 100644 (file)
@@ -29,7 +29,7 @@ char *svc_strings[128] =
        "svc_nop",
        "svc_disconnect",
        "svc_updatestat",
-       "svc_version",          // [long] server version
+       "svc_version",          // [int] server version
        "svc_setview",          // [short] entity number
        "svc_sound",                    // <see code>
        "svc_time",                     // [float] server time
@@ -38,7 +38,7 @@ char *svc_strings[128] =
                                                // the string should be \n terminated
        "svc_setangle",         // [vec3] set the view angle to this absolute value
 
-       "svc_serverinfo",               // [long] version
+       "svc_serverinfo",               // [int] version
                                                // [string] signon string
                                                // [string]..[0]model cache [string]...[0]sounds cache
                                                // [string]..[0]item cache
@@ -280,29 +280,29 @@ Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
 
        case 2:
                MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, va("name \"%s\"\n", cl_name.string));
+               MSG_WriteString (&cls.message, va("name \"%s\"", cl_name.string));
 
                MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, va("color %i %i\n", cl_color.integer >> 4, cl_color.integer & 15));
+               MSG_WriteString (&cls.message, va("color %i %i", cl_color.integer >> 4, cl_color.integer & 15));
 
                if (cl_pmodel.integer)
                {
                        MSG_WriteByte (&cls.message, clc_stringcmd);
-                       MSG_WriteString (&cls.message, va("pmodel %i\n", cl_pmodel.integer));
+                       MSG_WriteString (&cls.message, va("pmodel %i", cl_pmodel.integer));
                }
                if (*cl_playermodel.string)
                {
                        MSG_WriteByte (&cls.message, clc_stringcmd);
-                       MSG_WriteString (&cls.message, va("playermodel %s\n", cl_playermodel.string));
+                       MSG_WriteString (&cls.message, va("playermodel %s", cl_playermodel.string));
                }
                if (*cl_playerskin.string)
                {
                        MSG_WriteByte (&cls.message, clc_stringcmd);
-                       MSG_WriteString (&cls.message, va("playerskin %s\n", cl_playerskin.string));
+                       MSG_WriteString (&cls.message, va("playerskin %s", cl_playerskin.string));
                }
 
                MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, va("rate %i\n", cl_rate.integer));
+               MSG_WriteString (&cls.message, va("rate %i", cl_rate.integer));
 
                MSG_WriteByte (&cls.message, clc_stringcmd);
                MSG_WriteString (&cls.message, "spawn");
@@ -426,8 +426,8 @@ void CL_ParseServerInfo (void)
        // precache any models used by the client (this also marks them used)
        cl.model_bolt = Mod_ForName("progs/bolt.mdl", false, false, false);
        cl.model_bolt2 = Mod_ForName("progs/bolt2.mdl", false, false, false);
-       cl.model_bolt3 = Mod_ForName("progs/bolt3.mdl", true, false, false);
-       cl.model_beam = Mod_ForName("progs/beam.mdl", true, false, false);
+       cl.model_bolt3 = Mod_ForName("progs/bolt3.mdl", false, false, false);
+       cl.model_beam = Mod_ForName("progs/beam.mdl", false, false, false);
        Mod_PurgeUnused();
 
        // do the same for sounds
@@ -862,7 +862,7 @@ void CL_ParseBeam (model_t *m, int lightning)
        // override any beam with the same entity
        for (i = 0, b = cl_beams;i < cl_max_beams;i++, b++)
        {
-               if (b->entity == ent)
+               if (b->entity == ent && ent)
                {
                        //b->entity = ent;
                        b->lightning = lightning;
@@ -1489,7 +1489,7 @@ void CL_ParseServerMessage(void)
                                Host_Error ("svc_lightstyle >= MAX_LIGHTSTYLES");
                        strlcpy (cl_lightstyle[i].map,  MSG_ReadString(), sizeof (cl_lightstyle[i].map));
                        cl_lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
-                       cl_lightstyle[i].length = strlen(cl_lightstyle[i].map);
+                       cl_lightstyle[i].length = (int)strlen(cl_lightstyle[i].map);
                        break;
 
                case svc_sound: