]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
cl_parse: Only print if server actually disconnected
[xonotic/darkplaces.git] / cl_parse.c
index a78b67f61921e0c429836e0d195d99784abaec54..3d5274d232ae375e0b6b6b33ebef45efb2cd22ec 100644 (file)
@@ -1953,7 +1953,7 @@ static void CL_ParseServerInfo (void)
 
 void CL_ValidateState(entity_state_t *s)
 {
-       dp_model_t *model;
+       model_t *model;
 
        if (!s->active)
                return;
@@ -2300,7 +2300,7 @@ static void CL_ParseStaticSound (int large)
        int                     sound_num, vol, atten;
 
        MSG_ReadVector(&cl_message, org, cls.protocol);
-       if (large || cls.protocol == PROTOCOL_NEHAHRABJP2)
+       if (large)
                sound_num = (unsigned short) MSG_ReadShort(&cl_message);
        else
                sound_num = MSG_ReadByte(&cl_message);
@@ -2345,7 +2345,7 @@ static void CL_ParseEffect2 (void)
        CL_Effect(org, CL_GetModelByIndex(modelindex), startframe, framecount, framerate);
 }
 
-void CL_NewBeam (int ent, vec3_t start, vec3_t end, dp_model_t *m, int lightning)
+void CL_NewBeam (int ent, vec3_t start, vec3_t end, model_t *m, int lightning)
 {
        int i;
        beam_t *b = NULL;
@@ -2384,7 +2384,7 @@ void CL_NewBeam (int ent, vec3_t start, vec3_t end, dp_model_t *m, int lightning
                Con_DPrint("beam list overflow!\n");
 }
 
-static void CL_ParseBeam (dp_model_t *m, int lightning)
+static void CL_ParseBeam (model_t *m, int lightning)
 {
        int ent;
        vec3_t start, end;
@@ -3491,11 +3491,13 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case qw_svc_disconnect:
-                               Con_Printf("Server disconnected\n");
                                if (cls.demonum != -1)
                                        CL_NextDemo();
                                else
+                               {
+                                       Con_Printf("Server disconnected\n");
                                        CL_Disconnect();
+                               }
                                return;
 
                        case qw_svc_print:
@@ -3872,11 +3874,13 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case svc_disconnect:
-                               Con_Printf ("Server disconnected\n");
                                if (cls.demonum != -1)
                                        CL_NextDemo ();
                                else
+                               {
+                                       Con_Printf ("Server disconnected\n");
                                        CL_Disconnect ();
+                               }
                                break;
 
                        case svc_print:
@@ -3976,7 +3980,7 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case svc_sound:
-                               CL_ParseStartSoundPacket(false);
+                               CL_ParseStartSoundPacket(cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 ? true : false);
                                break;
 
                        case svc_precache:
@@ -3994,7 +3998,7 @@ void CL_ParseServerMessage(void)
                                        {
                                                if (i >= 1 && i < MAX_MODELS)
                                                {
-                                                       dp_model_t *model = Mod_ForName(s, false, false, s[0] == '*' ? cl.model_name[1] : NULL);
+                                                       model_t *model = Mod_ForName(s, false, false, s[0] == '*' ? cl.model_name[1] : NULL);
                                                        if (!model)
                                                                Con_DPrintf("svc_precache: Mod_ForName(\"%s\") failed\n", s);
                                                        cl.model_precache[i] = model;
@@ -4125,7 +4129,7 @@ void CL_ParseServerMessage(void)
                                break;
 
                        case svc_spawnstaticsound:
-                               CL_ParseStaticSound (false);
+                               CL_ParseStaticSound (cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 ? true : false);
                                break;
 
                        case svc_spawnstaticsound2: