]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
cmd: Fix double free/use-after-free bugs in defer. Fixed infinite loop in defer cmd...
[xonotic/darkplaces.git] / cl_parse.c
index 685233bcdbd8f32bc0059255eb18766ef60347c0..e35e43c2fffd26c57cc98c0eb9cb795dc1e9b136 100644 (file)
@@ -1335,7 +1335,6 @@ static void CL_BeginDownloads(qboolean aborteddownload)
                        dpsnprintf(soundname, sizeof(soundname), "sound/%s", cl.sound_name[cl.downloadsound_current]);
                        if (!FS_FileExists(soundname) && !FS_FileExists(cl.sound_name[cl.downloadsound_current]))
                        {
-                               Con_Printf("Sound %s not found\n", soundname);
                                if (cl_serverextension_download.integer && cls.netcon && !sv.active)
                                {
                                        CL_ForwardToServer(va(vabuf, sizeof(vabuf), "download %s", soundname));
@@ -1715,7 +1714,7 @@ static void CL_ParseServerInfo (void)
        if (protocol == PROTOCOL_QUAKEDP && cls.demoplayback && gamemode == GAME_NEHAHRA)
                protocol = PROTOCOL_NEHAHRAMOVIE;
        cls.protocol = protocol;
-       Con_DPrintf("Server protocol is %s\n", Protocol_NameForEnum(cls.protocol));
+       Con_Printf("Server protocol is %s\n", Protocol_NameForEnum(cls.protocol));
 
        cl.num_entities = 1;
 
@@ -2068,11 +2067,7 @@ void CL_MoveLerpEntityStates(entity_t *ent)
        {
                // not a monster
                ent->persistent.lerpstarttime = ent->state_previous.time;
-               // no lerp if it's singleplayer
-               if (cl.islocalgame && !sv_fixedframeratesingleplayer.integer)
-                       ent->persistent.lerpdeltatime = 0;
-               else
-                       ent->persistent.lerpdeltatime = bound(0, ent->state_current.time - ent->state_previous.time, 0.1);
+               ent->persistent.lerpdeltatime = bound(0, ent->state_current.time - ent->state_previous.time, 0.1);
                VectorCopy(ent->persistent.neworigin, ent->persistent.oldorigin);
                VectorCopy(ent->persistent.newangles, ent->persistent.oldangles);
                VectorCopy(ent->state_current.origin, ent->persistent.neworigin);
@@ -2333,7 +2328,7 @@ static void CL_ParseEffect (void)
        framecount = MSG_ReadByte(&cl_message);
        framerate = MSG_ReadByte(&cl_message);
 
-       CL_Effect(org, modelindex, startframe, framecount, framerate);
+       CL_Effect(org, CL_GetModelByIndex(modelindex), startframe, framecount, framerate);
 }
 
 static void CL_ParseEffect2 (void)
@@ -2347,7 +2342,7 @@ static void CL_ParseEffect2 (void)
        framecount = MSG_ReadByte(&cl_message);
        framerate = MSG_ReadByte(&cl_message);
 
-       CL_Effect(org, modelindex, startframe, framecount, framerate);
+       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)
@@ -2386,7 +2381,7 @@ void CL_NewBeam (int ent, vec3_t start, vec3_t end, dp_model_t *m, int lightning
                VectorCopy (end, b->end);
        }
        else
-               Con_Print("beam list overflow!\n");
+               Con_DPrint("beam list overflow!\n");
 }
 
 static void CL_ParseBeam (dp_model_t *m, int lightning)
@@ -2484,7 +2479,7 @@ static void CL_ParseTempEntity(void)
                        CL_FindNonSolidLocation(pos, pos, 10);
                        CL_ParticleEffect(EFFECT_TE_EXPLOSION, 1, pos, pos, vec3_origin, vec3_origin, NULL, 0);
                        S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
-                       CL_Effect(pos, cl.qw_modelindex_s_explod, 0, 6, 10);
+                       CL_Effect(pos, CL_GetModelByIndex(cl.qw_modelindex_s_explod), 0, 6, 10);
                        break;
 
                case QW_TE_TAREXPLOSION:
@@ -3286,7 +3281,7 @@ static void CL_NetworkTimeReceived(double newtime)
        double timehigh;
        cl.mtime[1] = cl.mtime[0];
        cl.mtime[0] = newtime;
-       if (cl_nolerp.integer || cls.timedemo || (cl.islocalgame && !sv_fixedframeratesingleplayer.integer) || cl.mtime[1] == cl.mtime[0] || cls.signon < SIGNONS)
+       if (cl_nolerp.integer || cls.timedemo || cl.mtime[1] == cl.mtime[0] || cls.signon < SIGNONS)
                cl.time = cl.mtime[1] = newtime;
        else if (cls.demoplayback)
        {