]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
Fix client version of ambientsound
[xonotic/darkplaces.git] / cl_parse.c
index 2363b0f02bec451b899a3aa0ed314fd63e57ec10..d3b0ea8a6ba37a6f9b24bd4eb08b261cc2084342 100644 (file)
@@ -468,6 +468,7 @@ void CL_ParseEntityLump(char *entdata)
                R_SetSkyBox("unit1_");
 }
 
+extern cvar_t con_chatsound_team_file;
 static const vec3_t defaultmins = {-4096, -4096, -4096};
 static const vec3_t defaultmaxs = {4096, 4096, 4096};
 static void CL_SetupWorldModel(void)
@@ -512,7 +513,7 @@ static void CL_SetupWorldModel(void)
        CL_KeepaliveMessage(false);
 
        // load the team chat beep if possible
-       cl.foundtalk2wav = FS_FileExists("sound/misc/talk2.wav");
+       cl.foundteamchatsound = FS_FileExists(con_chatsound_team_file.string);
 
        // check memory integrity
        Mem_CheckSentinelsGlobal();
@@ -1563,35 +1564,37 @@ static void CL_DownloadFinished_f(cmd_state_t *cmd)
        CL_BeginDownloads(false);
 }
 
+extern cvar_t topcolor;
+extern cvar_t bottomcolor;
 static void CL_SendPlayerInfo(void)
 {
        char vabuf[1024];
        MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
-       MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "name \"%s\"", cl_name.string));
+       MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "name \"%s\"", name.string));
 
        MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
-       MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", cl_color.integer >> 4, cl_color.integer & 15));
+       MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "color %i %i", topcolor.integer, bottomcolor.integer));
 
        MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
-       MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "rate %i", cl_rate.integer));
+       MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "rate %i", rate.integer));
 
        MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
-       MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "rate_burstsize %i", cl_rate_burstsize.integer));
+       MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "rate_burstsize %i", rate_burstsize.integer));
 
-       if (cl_pmodel.integer)
+       if (pmodel.integer)
        {
                MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
-               MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "pmodel %i", cl_pmodel.integer));
+               MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "pmodel %i", pmodel.integer));
        }
-       if (*cl_playermodel.string)
+       if (*playermodel.string)
        {
                MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
-               MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "playermodel %s", cl_playermodel.string));
+               MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "playermodel %s", playermodel.string));
        }
-       if (*cl_playerskin.string)
+       if (*playerskin.string)
        {
                MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
-               MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "playerskin %s", cl_playerskin.string));
+               MSG_WriteString (&cls.netcon->message, va(vabuf, sizeof(vabuf), "playerskin %s", playerskin.string));
        }
 }
 
@@ -2797,7 +2800,7 @@ static void CL_ParseTempEntity(void)
                        color[2] = MSG_ReadCoord(&cl_message, cls.protocol) * (2.0f / 1.0f);
                        CL_ParticleExplosion(pos);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
-                       CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+                       CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, NULL, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                        S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
@@ -2810,7 +2813,7 @@ static void CL_ParseTempEntity(void)
                        color[1] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
                        color[2] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
-                       CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+                       CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, NULL, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                        S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
@@ -2837,7 +2840,7 @@ static void CL_ParseTempEntity(void)
                        color[1] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
                        color[2] = MSG_ReadByte(&cl_message) * (2.0f / 255.0f);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
-                       CL_AllocLightFlash(NULL, &tempmatrix, radius, color[0], color[1], color[2], radius / velspeed, velspeed, 0, -1, true, 1, 0.25, 1, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+                       CL_AllocLightFlash(NULL, &tempmatrix, radius, color[0], color[1], color[2], radius / velspeed, velspeed, NULL, -1, true, 1, 0.25, 1, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                        break;
 
                case TE_FLAMEJET:
@@ -2898,7 +2901,7 @@ static void CL_ParseTempEntity(void)
                        color[1] = tempcolor[1] * (2.0f / 255.0f);
                        color[2] = tempcolor[2] * (2.0f / 255.0f);
                        Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
-                       CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+                       CL_AllocLightFlash(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, NULL, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                        S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
                        break;
 
@@ -3404,7 +3407,7 @@ void CL_ParseServerMessage(void)
        //if (cls.demorecording)
        //      CL_WriteDemoMessage (&cl_message);
 
-       cl.last_received_message = realtime;
+       cl.last_received_message = host.realtime;
 
        CL_KeepaliveMessage(false);
 
@@ -3412,7 +3415,7 @@ void CL_ParseServerMessage(void)
 // if recording demos, copy the message out
 //
        if (cl_shownet.integer == 1)
-               Con_Printf("%f %i\n", realtime, cl_message.cursize);
+               Con_Printf("%f %i\n", host.realtime, cl_message.cursize);
        else if (cl_shownet.integer == 2)
                Con_Print("------------------\n");
 
@@ -3425,7 +3428,7 @@ void CL_ParseServerMessage(void)
 
        if (cls.protocol == PROTOCOL_QUAKEWORLD)
        {
-               CL_NetworkTimeReceived(realtime); // qw has no clock
+               CL_NetworkTimeReceived(host.realtime); // qw has no clock
 
                // kill all qw nails
                cl.qw_num_nails = 0;