]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
changed 3 occurences of very if (developer.integer) Con_Print code to Con_DPrint
[xonotic/darkplaces.git] / cl_parse.c
index 3587de0f2bfe22a31465a966a33e0117d3827287..ecbe8f2bf621ffc593e3a692c5bfe82522418e17 100644 (file)
@@ -99,8 +99,6 @@ char *svc_strings[128] =
 cvar_t demo_nehahra = {0, "demo_nehahra", "0"};
 cvar_t developer_networkentities = {0, "developer_networkentities", "0"};
 
-mempool_t *cl_scores_mempool;
-
 /*
 ==================
 CL_ParseStartSoundPacket
@@ -337,6 +335,7 @@ void CL_ParseServerInfo (void)
        entity_t *ent;
 
        Con_DPrint("Serverinfo packet received.\n");
+
 //
 // wipe the client_state_t struct
 //
@@ -362,8 +361,7 @@ void CL_ParseServerInfo (void)
                Host_Error("Bad maxclients (%u) from server\n", cl.maxclients);
                return;
        }
-       Mem_EmptyPool(cl_scores_mempool);
-       cl.scores = Mem_Alloc(cl_scores_mempool, cl.maxclients*sizeof(*cl.scores));
+       cl.scores = Mem_Alloc(cl_mempool, cl.maxclients*sizeof(*cl.scores));
 
 // parse gametype
        cl.gametype = MSG_ReadByte ();
@@ -608,9 +606,9 @@ CL_ParseClientdata
 Server information pertaining to this client only
 ==================
 */
-void CL_ParseClientdata (int bits)
+void CL_ParseClientdata (void)
 {
-       int i, j;
+       int i, j, bits;
 
        VectorCopy (cl.mpunchangle[0], cl.mpunchangle[1]);
        VectorCopy (cl.mpunchvector[0], cl.mpunchvector[1]);
@@ -635,7 +633,7 @@ void CL_ParseClientdata (int bits)
        cl.mvelocity[0][2] = 0;
        cl.mviewzoom[0] = 1;
 
-       bits &= 0xFFFF;
+       bits = (unsigned short) MSG_ReadShort ();
        if (bits & SU_EXTEND1)
                bits |= (MSG_ReadByte() << 16);
        if (bits & SU_EXTEND2)
@@ -678,7 +676,8 @@ void CL_ParseClientdata (int bits)
                }
        }
 
-       if (bits & SU_ITEMS)
+       // LordHavoc: hipnotic demos don't have this bit set but should
+       if (bits & SU_ITEMS || cl.protocol != PROTOCOL_DARKPLACES6)
                cl.stats[STAT_ITEMS] = MSG_ReadLong ();
 
        cl.onground = (bits & SU_ONGROUND) != 0;
@@ -1206,7 +1205,7 @@ void CL_ParseTempEntity(void)
        case TE_CUSTOMFLASH:
                MSG_ReadVector(pos, cl.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
-               radius = MSG_ReadByte() * 8;
+               radius = (MSG_ReadByte() + 1) * 8;
                velspeed = (MSG_ReadByte() + 1) * (1.0 / 256.0);
                color[0] = MSG_ReadByte() * (2.0f / 255.0f);
                color[1] = MSG_ReadByte() * (2.0f / 255.0f);
@@ -1341,6 +1340,7 @@ void CL_ParseServerMessage(void)
        qbyte           cmdlog[32];
        char            *cmdlogname[32], *temp;
        int                     cmdindex, cmdcount = 0;
+       qboolean        sendmove = false;
 
        if (cls.demorecording)
                CL_WriteDemoMessage ();
@@ -1441,11 +1441,11 @@ void CL_ParseServerMessage(void)
                case svc_time:
                        cl.mtime[1] = cl.mtime[0];
                        cl.mtime[0] = MSG_ReadFloat ();
+                       sendmove = true;
                        break;
 
                case svc_clientdata:
-                       i = (unsigned short) MSG_ReadShort ();
-                       CL_ParseClientdata (i);
+                       CL_ParseClientdata();
                        break;
 
                case svc_version:
@@ -1760,6 +1760,12 @@ void CL_ParseServerMessage(void)
 
        EntityFrameQuake_ISeeDeadEntities();
 
+       if (sendmove)
+       {
+               // send one move per server frame
+               CL_SendMove();
+       }
+
        parsingerror = false;
 }
 
@@ -1775,7 +1781,6 @@ void CL_Parse_DumpPacket(void)
 void CL_Parse_Init(void)
 {
        // LordHavoc: added demo_nehahra cvar
-       cl_scores_mempool = Mem_AllocPool("client player info", 0, NULL);
        Cvar_RegisterVariable (&demo_nehahra);
        if (gamemode == GAME_NEHAHRA)
                Cvar_SetValue("demo_nehahra", 1);
@@ -1784,5 +1789,4 @@ void CL_Parse_Init(void)
 
 void CL_Parse_Shutdown(void)
 {
-       Mem_FreePool (&cl_scores_mempool);
 }