renamed cl.protocol to cls.protocol
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 24 Feb 2006 05:18:03 +0000 (05:18 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 24 Feb 2006 05:18:03 +0000 (05:18 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6024 d7cf8633-e32d-0410-b094-e92efae38249

cl_input.c
cl_main.c
cl_parse.c
cl_particles.c
client.h
clvm_cmds.c
protocol.c
view.c

index 8bc8ef1..c38a8bf 100644 (file)
@@ -914,7 +914,7 @@ void CL_SendMove(void)
                        // PROTOCOL_DARKPLACES5  clc_move = 19 bytes total
                        // PROTOCOL_DARKPLACES6  clc_move = 52 bytes total
                        // PROTOCOL_DARKPLACES7  clc_move = 56 bytes total
-                       if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_QUAKEDP || cl.protocol == PROTOCOL_NEHAHRAMOVIE)
+                       if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE)
                        {
                                // 5 bytes
                                MSG_WriteByte (&buf, clc_move);
@@ -930,7 +930,7 @@ void CL_SendMove(void)
                                MSG_WriteByte (&buf, bits);
                                MSG_WriteByte (&buf, impulse);
                        }
-                       else if (cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3)
+                       else if (cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3)
                        {
                                // 5 bytes
                                MSG_WriteByte (&buf, clc_move);
@@ -946,7 +946,7 @@ void CL_SendMove(void)
                                MSG_WriteByte (&buf, bits);
                                MSG_WriteByte (&buf, impulse);
                        }
-                       else if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES4 || cl.protocol == PROTOCOL_DARKPLACES5)
+                       else if (cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5)
                        {
                                // 5 bytes
                                MSG_WriteByte (&buf, clc_move);
@@ -966,7 +966,7 @@ void CL_SendMove(void)
                        {
                                // 5 bytes
                                MSG_WriteByte (&buf, clc_move);
-                               if (cl.protocol != PROTOCOL_DARKPLACES6)
+                               if (cls.protocol != PROTOCOL_DARKPLACES6)
                                {
                                        if (cl_movement.integer)
                                        {
index 3988281..d008691 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -1116,7 +1116,7 @@ void CL_LinkNetworkEntity(entity_t *e)
                // hide player shadow during intermission or nehahra movie
                if (!(e->render.effects & EF_NOSHADOW)
                 && !(e->render.flags & (RENDER_VIEWMODEL | RENDER_TRANSPARENT))
-                && (!(e->render.flags & RENDER_EXTERIORMODEL) || (!cl.intermission && cl.protocol != PROTOCOL_NEHAHRAMOVIE && !cl_noplayershadow.integer)))
+                && (!(e->render.flags & RENDER_EXTERIORMODEL) || (!cl.intermission && cls.protocol != PROTOCOL_NEHAHRAMOVIE && !cl_noplayershadow.integer)))
                        e->render.flags |= RENDER_SHADOW;
                // as soon as player is known we can call V_CalcRefDef
                if (!csqc_loaded)
index 5259676..44d20b2 100644 (file)
@@ -143,7 +143,7 @@ void CL_ParseStartSoundPacket(int largesoundindex)
        else
                sound_num = MSG_ReadByte ();
 
-       MSG_ReadVector(pos, cl.protocol);
+       MSG_ReadVector(pos, cls.protocol);
 
        if (sound_num >= MAX_SOUNDS)
        {
@@ -364,8 +364,8 @@ void CL_ParseServerInfo (void)
        // hack for unmarked Nehahra movie demos which had a custom protocol
        if (protocol == PROTOCOL_QUAKEDP && cls.demoplayback && demo_nehahra.integer)
                protocol = PROTOCOL_NEHAHRAMOVIE;
-       cl.protocol = protocol;
-       Con_DPrintf("Server protocol is %s\n", Protocol_NameForEnum(cl.protocol));
+       cls.protocol = protocol;
+       Con_DPrintf("Server protocol is %s\n", Protocol_NameForEnum(cls.protocol));
 
 // parse maxclients
        cl.maxclients = MSG_ReadByte ();
@@ -384,7 +384,7 @@ void CL_ParseServerInfo (void)
        strlcpy (cl.levelname, str, sizeof(cl.levelname));
 
 // seperate the printfs so the server message can have a color
-       if (cl.protocol != PROTOCOL_NEHAHRAMOVIE) // no messages when playing the Nehahra movie
+       if (cls.protocol != PROTOCOL_NEHAHRAMOVIE) // no messages when playing the Nehahra movie
                Con_Printf("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n\2%s\n", str);
 
        // check memory integrity
@@ -620,8 +620,8 @@ void CL_ParseBaseline (entity_t *ent, int large)
        ent->state_baseline.skin = MSG_ReadByte();
        for (i = 0;i < 3;i++)
        {
-               ent->state_baseline.origin[i] = MSG_ReadCoord(cl.protocol);
-               ent->state_baseline.angles[i] = MSG_ReadAngle(cl.protocol);
+               ent->state_baseline.origin[i] = MSG_ReadCoord(cls.protocol);
+               ent->state_baseline.angles[i] = MSG_ReadAngle(cls.protocol);
        }
        CL_ValidateState(&ent->state_baseline);
        ent->state_previous = ent->state_current = ent->state_baseline;
@@ -644,7 +644,7 @@ void CL_ParseClientdata (void)
        VectorCopy (cl.mvelocity[0], cl.mvelocity[1]);
        cl.mviewzoom[1] = cl.mviewzoom[0];
 
-       if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_QUAKEDP || cl.protocol == PROTOCOL_NEHAHRAMOVIE || cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4 || cl.protocol == PROTOCOL_DARKPLACES5)
+       if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5)
        {
                cl.stats[STAT_VIEWHEIGHT] = DEFAULT_VIEWHEIGHT;
                cl.stats[STAT_ITEMS] = 0;
@@ -678,21 +678,21 @@ void CL_ParseClientdata (void)
        {
                if (bits & (SU_PUNCH1<<i) )
                {
-                       if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_QUAKEDP || cl.protocol == PROTOCOL_NEHAHRAMOVIE)
+                       if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE)
                                cl.mpunchangle[0][i] = MSG_ReadChar();
                        else
                                cl.mpunchangle[0][i] = MSG_ReadAngle16i();
                }
                if (bits & (SU_PUNCHVEC1<<i))
                {
-                       if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
+                       if (cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4)
                                cl.mpunchvector[0][i] = MSG_ReadCoord16i();
                        else
                                cl.mpunchvector[0][i] = MSG_ReadCoord32f();
                }
                if (bits & (SU_VELOCITY1<<i) )
                {
-                       if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_QUAKEDP || cl.protocol == PROTOCOL_NEHAHRAMOVIE || cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
+                       if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4)
                                cl.mvelocity[0][i] = MSG_ReadChar()*16;
                        else
                                cl.mvelocity[0][i] = MSG_ReadCoord32f();
@@ -700,14 +700,14 @@ void CL_ParseClientdata (void)
        }
 
        // LordHavoc: hipnotic demos don't have this bit set but should
-       if (bits & SU_ITEMS || cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_QUAKEDP || cl.protocol == PROTOCOL_NEHAHRAMOVIE || cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4 || cl.protocol == PROTOCOL_DARKPLACES5)
+       if (bits & SU_ITEMS || cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5)
                cl.stats[STAT_ITEMS] = MSG_ReadLong ();
 
        cl.onground = (bits & SU_ONGROUND) != 0;
        csqc_onground = cl.onground;    //[515]: cause without this csqc will receive not right value on svc_print =/
        cl.inwater = (bits & SU_INWATER) != 0;
 
-       if (cl.protocol == PROTOCOL_DARKPLACES5)
+       if (cls.protocol == PROTOCOL_DARKPLACES5)
        {
                cl.stats[STAT_WEAPONFRAME] = (bits & SU_WEAPONFRAME) ? MSG_ReadShort() : 0;
                cl.stats[STAT_ARMOR] = (bits & SU_ARMOR) ? MSG_ReadShort() : 0;
@@ -720,7 +720,7 @@ void CL_ParseClientdata (void)
                cl.stats[STAT_CELLS] = MSG_ReadShort();
                cl.stats[STAT_ACTIVEWEAPON] = (unsigned short) MSG_ReadShort ();
        }
-       else if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_QUAKEDP || cl.protocol == PROTOCOL_NEHAHRAMOVIE || cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
+       else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4)
        {
                cl.stats[STAT_WEAPONFRAME] = (bits & SU_WEAPONFRAME) ? MSG_ReadByte() : 0;
                cl.stats[STAT_ARMOR] = (bits & SU_ARMOR) ? MSG_ReadByte() : 0;
@@ -739,7 +739,7 @@ void CL_ParseClientdata (void)
 
        if (bits & SU_VIEWZOOM)
        {
-               if (cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
+               if (cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4)
                        cl.stats[STAT_VIEWZOOM] = MSG_ReadByte();
                else
                        cl.stats[STAT_VIEWZOOM] = (unsigned short) MSG_ReadShort();
@@ -811,7 +811,7 @@ void CL_ParseStaticSound (int large)
        vec3_t          org;
        int                     sound_num, vol, atten;
 
-       MSG_ReadVector(org, cl.protocol);
+       MSG_ReadVector(org, cls.protocol);
        if (large)
                sound_num = (unsigned short) MSG_ReadShort ();
        else
@@ -827,7 +827,7 @@ void CL_ParseEffect (void)
        vec3_t          org;
        int                     modelindex, startframe, framecount, framerate;
 
-       MSG_ReadVector(org, cl.protocol);
+       MSG_ReadVector(org, cls.protocol);
        modelindex = MSG_ReadByte ();
        startframe = MSG_ReadByte ();
        framecount = MSG_ReadByte ();
@@ -841,7 +841,7 @@ void CL_ParseEffect2 (void)
        vec3_t          org;
        int                     modelindex, startframe, framecount, framerate;
 
-       MSG_ReadVector(org, cl.protocol);
+       MSG_ReadVector(org, cls.protocol);
        modelindex = (unsigned short) MSG_ReadShort ();
        startframe = (unsigned short) MSG_ReadShort ();
        framecount = MSG_ReadByte ();
@@ -857,8 +857,8 @@ void CL_ParseBeam (model_t *m, int lightning)
        beam_t *b = NULL;
 
        ent = (unsigned short) MSG_ReadShort ();
-       MSG_ReadVector(start, cl.protocol);
-       MSG_ReadVector(end, cl.protocol);
+       MSG_ReadVector(start, cls.protocol);
+       MSG_ReadVector(end, cls.protocol);
 
        if (ent >= MAX_EDICTS)
        {
@@ -933,7 +933,7 @@ void CL_ParseTempEntity(void)
        {
        case TE_WIZSPIKE:
                // spike hitting wall
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                //CL_AllocDlight(NULL, &tempmatrix, 100, 0.12f, 0.50f, 0.12f, 500, 0.2, 0, -1, false, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
@@ -943,7 +943,7 @@ void CL_ParseTempEntity(void)
 
        case TE_KNIGHTSPIKE:
                // spike hitting wall
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                //CL_AllocDlight(NULL, &tempmatrix, 100, 0.50f, 0.30f, 0.10f, 500, 0.2, 0, -1, false, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
@@ -953,7 +953,7 @@ void CL_ParseTempEntity(void)
 
        case TE_SPIKE:
                // spike hitting wall
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                if (cl_particles_quake.integer)
                        CL_RunParticleEffect(pos, vec3_origin, 0, 10);
@@ -978,7 +978,7 @@ void CL_ParseTempEntity(void)
                break;
        case TE_SPIKEQUAD:
                // quad spike hitting wall
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                if (cl_particles_quake.integer)
                        CL_RunParticleEffect(pos, vec3_origin, 0, 10);
@@ -1005,7 +1005,7 @@ void CL_ParseTempEntity(void)
                break;
        case TE_SUPERSPIKE:
                // super spike hitting wall
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                if (cl_particles_quake.integer)
                        CL_RunParticleEffect(pos, vec3_origin, 0, 20);
@@ -1030,7 +1030,7 @@ void CL_ParseTempEntity(void)
                break;
        case TE_SUPERSPIKEQUAD:
                // quad super spike hitting wall
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                if (cl_particles_quake.integer)
                        CL_RunParticleEffect(pos, vec3_origin, 0, 20);
@@ -1058,7 +1058,7 @@ void CL_ParseTempEntity(void)
                // LordHavoc: added for improved blood splatters
        case TE_BLOOD:
                // blood puff
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                dir[0] = MSG_ReadChar();
                dir[1] = MSG_ReadChar();
@@ -1068,7 +1068,7 @@ void CL_ParseTempEntity(void)
                break;
        case TE_SPARK:
                // spark shower
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                dir[0] = MSG_ReadChar();
                dir[1] = MSG_ReadChar();
@@ -1077,7 +1077,7 @@ void CL_ParseTempEntity(void)
                CL_SparkShower(pos, dir, count, 1);
                break;
        case TE_PLASMABURN:
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                CL_AllocDlight(NULL, &tempmatrix, 200, 1, 1, 1, 1000, 0.2, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
@@ -1086,29 +1086,29 @@ void CL_ParseTempEntity(void)
                // LordHavoc: added for improved gore
        case TE_BLOODSHOWER:
                // vaporized body
-               MSG_ReadVector(pos, cl.protocol); // mins
-               MSG_ReadVector(pos2, cl.protocol); // maxs
-               velspeed = MSG_ReadCoord(cl.protocol); // speed
+               MSG_ReadVector(pos, cls.protocol); // mins
+               MSG_ReadVector(pos2, cls.protocol); // maxs
+               velspeed = MSG_ReadCoord(cls.protocol); // speed
                count = (unsigned short) MSG_ReadShort(); // number of particles
                CL_BloodShower(pos, pos2, velspeed, count);
                break;
        case TE_PARTICLECUBE:
                // general purpose particle effect
-               MSG_ReadVector(pos, cl.protocol); // mins
-               MSG_ReadVector(pos2, cl.protocol); // maxs
-               MSG_ReadVector(dir, cl.protocol); // dir
+               MSG_ReadVector(pos, cls.protocol); // mins
+               MSG_ReadVector(pos2, cls.protocol); // maxs
+               MSG_ReadVector(dir, cls.protocol); // dir
                count = (unsigned short) MSG_ReadShort(); // number of particles
                colorStart = MSG_ReadByte(); // color
                colorLength = MSG_ReadByte(); // gravity (1 or 0)
-               velspeed = MSG_ReadCoord(cl.protocol); // randomvel
+               velspeed = MSG_ReadCoord(cls.protocol); // randomvel
                CL_ParticleCube(pos, pos2, dir, count, colorStart, colorLength, velspeed);
                break;
 
        case TE_PARTICLERAIN:
                // general purpose particle effect
-               MSG_ReadVector(pos, cl.protocol); // mins
-               MSG_ReadVector(pos2, cl.protocol); // maxs
-               MSG_ReadVector(dir, cl.protocol); // dir
+               MSG_ReadVector(pos, cls.protocol); // mins
+               MSG_ReadVector(pos2, cls.protocol); // maxs
+               MSG_ReadVector(dir, cls.protocol); // dir
                count = (unsigned short) MSG_ReadShort(); // number of particles
                colorStart = MSG_ReadByte(); // color
                CL_ParticleRain(pos, pos2, dir, count, colorStart, 0);
@@ -1116,9 +1116,9 @@ void CL_ParseTempEntity(void)
 
        case TE_PARTICLESNOW:
                // general purpose particle effect
-               MSG_ReadVector(pos, cl.protocol); // mins
-               MSG_ReadVector(pos2, cl.protocol); // maxs
-               MSG_ReadVector(dir, cl.protocol); // dir
+               MSG_ReadVector(pos, cls.protocol); // mins
+               MSG_ReadVector(pos2, cls.protocol); // maxs
+               MSG_ReadVector(dir, cls.protocol); // dir
                count = (unsigned short) MSG_ReadShort(); // number of particles
                colorStart = MSG_ReadByte(); // color
                CL_ParticleRain(pos, pos2, dir, count, colorStart, 1);
@@ -1126,7 +1126,7 @@ void CL_ParseTempEntity(void)
 
        case TE_GUNSHOT:
                // bullet hitting wall
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                if (cl_particles_quake.integer)
                        CL_RunParticleEffect(pos, vec3_origin, 0, 20);
@@ -1140,7 +1140,7 @@ void CL_ParseTempEntity(void)
 
        case TE_GUNSHOTQUAD:
                // quad bullet hitting wall
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                if (cl_particles_quake.integer)
                        CL_RunParticleEffect(pos, vec3_origin, 0, 20);
@@ -1156,7 +1156,7 @@ void CL_ParseTempEntity(void)
 
        case TE_EXPLOSION:
                // rocket explosion
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 10);
                CL_ParticleExplosion(pos);
                // LordHavoc: boosted color from 1.0, 0.8, 0.4 to 1.25, 1.0, 0.5
@@ -1168,7 +1168,7 @@ void CL_ParseTempEntity(void)
 
        case TE_EXPLOSIONQUAD:
                // quad rocket explosion
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 10);
                CL_ParticleExplosion(pos);
                Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
@@ -1179,13 +1179,13 @@ void CL_ParseTempEntity(void)
 
        case TE_EXPLOSION3:
                // Nehahra movie colored lighting explosion
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 10);
                CL_ParticleExplosion(pos);
                Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
-               color[0] = MSG_ReadCoord(cl.protocol) * (2.0f / 1.0f);
-               color[1] = MSG_ReadCoord(cl.protocol) * (2.0f / 1.0f);
-               color[2] = MSG_ReadCoord(cl.protocol) * (2.0f / 1.0f);
+               color[0] = MSG_ReadCoord(cls.protocol) * (2.0f / 1.0f);
+               color[1] = MSG_ReadCoord(cls.protocol) * (2.0f / 1.0f);
+               color[2] = MSG_ReadCoord(cls.protocol) * (2.0f / 1.0f);
                CL_AllocDlight(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);
                if (gamemode != GAME_NEXUIZ)
                        S_StartSound(-1, 0, cl.sfx_r_exp3, pos, 1, 1);
@@ -1193,7 +1193,7 @@ void CL_ParseTempEntity(void)
 
        case TE_EXPLOSIONRGB:
                // colored lighting explosion
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 10);
                CL_ParticleExplosion(pos);
                color[0] = MSG_ReadByte() * (2.0f / 255.0f);
@@ -1207,7 +1207,7 @@ void CL_ParseTempEntity(void)
 
        case TE_TAREXPLOSION:
                // tarbaby explosion
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 10);
                CL_BlobExplosion(pos);
 
@@ -1218,14 +1218,14 @@ void CL_ParseTempEntity(void)
                break;
 
        case TE_SMALLFLASH:
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 10);
                Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                CL_AllocDlight(NULL, &tempmatrix, 200, 2, 2, 2, 1000, 0.2, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                break;
 
        case TE_CUSTOMFLASH:
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 4);
                radius = (MSG_ReadByte() + 1) * 8;
                velspeed = (MSG_ReadByte() + 1) * (1.0 / 256.0);
@@ -1237,8 +1237,8 @@ void CL_ParseTempEntity(void)
                break;
 
        case TE_FLAMEJET:
-               MSG_ReadVector(pos, cl.protocol);
-               MSG_ReadVector(dir, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
+               MSG_ReadVector(dir, cls.protocol);
                count = MSG_ReadByte();
                CL_Flames(pos, dir, count);
                break;
@@ -1271,12 +1271,12 @@ void CL_ParseTempEntity(void)
                break;
 
        case TE_LAVASPLASH:
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_LavaSplash(pos);
                break;
 
        case TE_TELEPORT:
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
                CL_AllocDlight(NULL, &tempmatrix, 200, 1.0f, 1.0f, 1.0f, 600, 99.0f, 0, -1, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                CL_TeleportSplash(pos);
@@ -1284,7 +1284,7 @@ void CL_ParseTempEntity(void)
 
        case TE_EXPLOSION2:
                // color mapped explosion
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 10);
                colorStart = MSG_ReadByte();
                colorLength = MSG_ReadByte();
@@ -1300,22 +1300,22 @@ void CL_ParseTempEntity(void)
                break;
 
        case TE_TEI_G3:
-               MSG_ReadVector(pos, cl.protocol);
-               MSG_ReadVector(pos2, cl.protocol);
-               MSG_ReadVector(dir, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
+               MSG_ReadVector(pos2, cls.protocol);
+               MSG_ReadVector(dir, cls.protocol);
                CL_BeamParticle(pos, pos2, 8, 1, 1, 1, 1, 1);
                break;
 
        case TE_TEI_SMOKE:
-               MSG_ReadVector(pos, cl.protocol);
-               MSG_ReadVector(dir, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
+               MSG_ReadVector(dir, cls.protocol);
                count = MSG_ReadByte();
                CL_FindNonSolidLocation(pos, pos, 4);
                CL_Tei_Smoke(pos, dir, count);
                break;
 
        case TE_TEI_BIGEXPLOSION:
-               MSG_ReadVector(pos, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
                CL_FindNonSolidLocation(pos, pos, 10);
                CL_ParticleExplosion(pos);
                Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
@@ -1325,8 +1325,8 @@ void CL_ParseTempEntity(void)
                break;
 
        case TE_TEI_PLASMAHIT:
-               MSG_ReadVector(pos, cl.protocol);
-               MSG_ReadVector(dir, cl.protocol);
+               MSG_ReadVector(pos, cls.protocol);
+               MSG_ReadVector(dir, cls.protocol);
                count = MSG_ReadByte();
                CL_FindNonSolidLocation(pos, pos, 5);
                CL_Tei_PlasmaHit(pos, dir, count);
@@ -1480,7 +1480,7 @@ void CL_ParseServerMessage(void)
                        // hack for unmarked Nehahra movie demos which had a custom protocol
                        if (protocol == PROTOCOL_QUAKEDP && cls.demoplayback && demo_nehahra.integer)
                                protocol = PROTOCOL_NEHAHRAMOVIE;
-                       cl.protocol = protocol;
+                       cls.protocol = protocol;
                        break;
 
                case svc_disconnect:
@@ -1514,7 +1514,7 @@ void CL_ParseServerMessage(void)
 
                case svc_setangle:
                        for (i=0 ; i<3 ; i++)
-                               cl.viewangles[i] = MSG_ReadAngle (cl.protocol);
+                               cl.viewangles[i] = MSG_ReadAngle (cls.protocol);
                        break;
 
                case svc_setview:
@@ -1545,7 +1545,7 @@ void CL_ParseServerMessage(void)
                        break;
 
                case svc_precache:
-                       if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3)
+                       if (cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3)
                        {
                                // was svc_sound2 in protocols 1, 2, 3, removed in 4, 5, changed to svc_precache in 6
                                CL_ParseStartSoundPacket(true);
@@ -1729,12 +1729,12 @@ void CL_ParseServerMessage(void)
                        if (gamemode == GAME_TENEBRAE)
                        {
                                // repeating particle effect
-                               MSG_ReadCoord(cl.protocol);
-                               MSG_ReadCoord(cl.protocol);
-                               MSG_ReadCoord(cl.protocol);
-                               MSG_ReadCoord(cl.protocol);
-                               MSG_ReadCoord(cl.protocol);
-                               MSG_ReadCoord(cl.protocol);
+                               MSG_ReadCoord(cls.protocol);
+                               MSG_ReadCoord(cls.protocol);
+                               MSG_ReadCoord(cls.protocol);
+                               MSG_ReadCoord(cls.protocol);
+                               MSG_ReadCoord(cls.protocol);
+                               MSG_ReadCoord(cls.protocol);
                                MSG_ReadByte();
                                MSG_ReadLong();
                                MSG_ReadLong();
@@ -1747,9 +1747,9 @@ void CL_ParseServerMessage(void)
                        if (gamemode == GAME_TENEBRAE)
                        {
                                // particle effect
-                               MSG_ReadCoord(cl.protocol);
-                               MSG_ReadCoord(cl.protocol);
-                               MSG_ReadCoord(cl.protocol);
+                               MSG_ReadCoord(cls.protocol);
+                               MSG_ReadCoord(cls.protocol);
+                               MSG_ReadCoord(cls.protocol);
                                MSG_ReadByte();
                                MSG_ReadString();
                        }
@@ -1776,9 +1776,9 @@ void CL_ParseServerMessage(void)
                                cls.signon = SIGNONS;
                                CL_SignonReply ();
                        }
-                       if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3)
+                       if (cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3)
                                EntityFrame_CL_ReadFrame();
-                       else if (cl.protocol == PROTOCOL_DARKPLACES4)
+                       else if (cls.protocol == PROTOCOL_DARKPLACES4)
                                EntityFrame4_CL_ReadFrame();
                        else
                                EntityFrame5_CL_ReadFrame();
index fcd0a22..e00b070 100644 (file)
@@ -604,7 +604,7 @@ void CL_ParseParticleEffect (void)
        vec3_t org, dir;
        int i, count, msgcount, color;
 
-       MSG_ReadVector(org, cl.protocol);
+       MSG_ReadVector(org, cls.protocol);
        for (i=0 ; i<3 ; i++)
                dir[i] = MSG_ReadChar ();
        msgcount = MSG_ReadByte ();
index f3a8bac..9dbe068 100644 (file)
--- a/client.h
+++ b/client.h
@@ -446,6 +446,9 @@ typedef struct client_static_s
        double connect_nextsendtime;
        lhnetsocket_t *connect_mysocket;
        lhnetaddress_t connect_address;
+       // protocol version of the server we're connected to
+       // (kept outside client_state_t because it's used between levels)
+       protocolversion_t protocol;
 
 // connection information
        // 0 to SIGNONS
@@ -637,9 +640,6 @@ typedef struct client_state_s
        // [cl.maxclients]
        scoreboard_t *scores;
 
-       // protocol version of the server we're connected to
-       protocolversion_t protocol;
-
        // entity database stuff
        // latest received entity frame numbers
 #define LATESTFRAMENUMS 3
index be40e09..435e75a 100644 (file)
@@ -1477,13 +1477,13 @@ void VM_CL_ReadLong (void)
 //#364 float() readcoord (EXT_CSQC)
 void VM_CL_ReadCoord (void)
 {
-       PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadCoord(cl.protocol);
+       PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadCoord(cls.protocol);
 }
 
 //#365 float() readangle (EXT_CSQC)
 void VM_CL_ReadAngle (void)
 {
-       PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadAngle(cl.protocol);
+       PRVM_G_FLOAT(OFS_RETURN) = MSG_ReadAngle(cls.protocol);
 }
 
 //#366 string() readstring (EXT_CSQC)
index 27f4ad5..970a4ef 100644 (file)
@@ -113,7 +113,7 @@ void EntityFrameQuake_ReadEntity(int bits)
 
        if (bits & U_MOREBITS)
                bits |= (MSG_ReadByte()<<8);
-       if ((bits & U_EXTEND1) && cl.protocol != PROTOCOL_NEHAHRAMOVIE)
+       if ((bits & U_EXTEND1) && cls.protocol != PROTOCOL_NEHAHRAMOVIE)
        {
                bits |= MSG_ReadByte() << 16;
                if (bits & U_EXTEND2)
@@ -161,12 +161,12 @@ void EntityFrameQuake_ReadEntity(int bits)
        if (bits & U_COLORMAP)  s.colormap = MSG_ReadByte();
        if (bits & U_SKIN)              s.skin = MSG_ReadByte();
        if (bits & U_EFFECTS)   s.effects = (s.effects & 0xFF00) | MSG_ReadByte();
-       if (bits & U_ORIGIN1)   s.origin[0] = MSG_ReadCoord(cl.protocol);
-       if (bits & U_ANGLE1)    s.angles[0] = MSG_ReadAngle(cl.protocol);
-       if (bits & U_ORIGIN2)   s.origin[1] = MSG_ReadCoord(cl.protocol);
-       if (bits & U_ANGLE2)    s.angles[1] = MSG_ReadAngle(cl.protocol);
-       if (bits & U_ORIGIN3)   s.origin[2] = MSG_ReadCoord(cl.protocol);
-       if (bits & U_ANGLE3)    s.angles[2] = MSG_ReadAngle(cl.protocol);
+       if (bits & U_ORIGIN1)   s.origin[0] = MSG_ReadCoord(cls.protocol);
+       if (bits & U_ANGLE1)    s.angles[0] = MSG_ReadAngle(cls.protocol);
+       if (bits & U_ORIGIN2)   s.origin[1] = MSG_ReadCoord(cls.protocol);
+       if (bits & U_ANGLE2)    s.angles[1] = MSG_ReadAngle(cls.protocol);
+       if (bits & U_ORIGIN3)   s.origin[2] = MSG_ReadCoord(cls.protocol);
+       if (bits & U_ANGLE3)    s.angles[2] = MSG_ReadAngle(cls.protocol);
        if (bits & U_STEP)              s.flags |= RENDER_STEP;
        if (bits & U_ALPHA)             s.alpha = MSG_ReadByte();
        if (bits & U_SCALE)             s.scale = MSG_ReadByte();
@@ -181,7 +181,7 @@ void EntityFrameQuake_ReadEntity(int bits)
        if (bits & U_EXTERIORMODEL)     s.flags |= RENDER_EXTERIORMODEL;
 
        // LordHavoc: to allow playback of the Nehahra movie
-       if (cl.protocol == PROTOCOL_NEHAHRAMOVIE && (bits & U_EXTEND1))
+       if (cls.protocol == PROTOCOL_NEHAHRAMOVIE && (bits & U_EXTEND1))
        {
                // LordHavoc: evil format
                int i = MSG_ReadFloat();
@@ -744,7 +744,7 @@ int EntityState_ReadExtendBits(void)
 
 void EntityState_ReadFields(entity_state_t *e, unsigned int bits)
 {
-       if (cl.protocol == PROTOCOL_DARKPLACES2)
+       if (cls.protocol == PROTOCOL_DARKPLACES2)
        {
                if (bits & E_ORIGIN1)
                        e->origin[0] = MSG_ReadCoord16i();
@@ -776,7 +776,7 @@ void EntityState_ReadFields(entity_state_t *e, unsigned int bits)
                                e->origin[2] = MSG_ReadCoord32f();
                }
        }
-       if ((cl.protocol == PROTOCOL_DARKPLACES5 || cl.protocol == PROTOCOL_DARKPLACES6) && !(e->flags & RENDER_LOWPRECISION))
+       if ((cls.protocol == PROTOCOL_DARKPLACES5 || cls.protocol == PROTOCOL_DARKPLACES6) && !(e->flags & RENDER_LOWPRECISION))
        {
                if (bits & E_ANGLE1)
                        e->angles[0] = MSG_ReadAngle16i();
@@ -818,7 +818,7 @@ void EntityState_ReadFields(entity_state_t *e, unsigned int bits)
                e->glowsize = MSG_ReadByte();
        if (bits & E_GLOWCOLOR)
                e->glowcolor = MSG_ReadByte();
-       if (cl.protocol == PROTOCOL_DARKPLACES2)
+       if (cls.protocol == PROTOCOL_DARKPLACES2)
                if (bits & E_FLAGS)
                        e->flags = MSG_ReadByte();
        if (bits & E_TAGATTACHMENT)
@@ -2045,7 +2045,7 @@ void EntityFrame5_CL_ReadFrame(void)
        cl.latestframenums[LATESTFRAMENUMS-1] = MSG_ReadLong();
        if (developer_networkentities.integer)
                Con_Printf("recv: svc_entities %i\n", cl.latestframenums[LATESTFRAMENUMS-1]);
-       if (cl.protocol != PROTOCOL_QUAKE && cl.protocol != PROTOCOL_QUAKEDP && cl.protocol != PROTOCOL_NEHAHRAMOVIE && cl.protocol != PROTOCOL_DARKPLACES1 && cl.protocol != PROTOCOL_DARKPLACES2 && cl.protocol != PROTOCOL_DARKPLACES3 && cl.protocol != PROTOCOL_DARKPLACES4 && cl.protocol != PROTOCOL_DARKPLACES5 && cl.protocol != PROTOCOL_DARKPLACES6)
+       if (cls.protocol != PROTOCOL_QUAKE && cls.protocol != PROTOCOL_QUAKEDP && cls.protocol != PROTOCOL_NEHAHRAMOVIE && cls.protocol != PROTOCOL_DARKPLACES1 && cls.protocol != PROTOCOL_DARKPLACES2 && cls.protocol != PROTOCOL_DARKPLACES3 && cls.protocol != PROTOCOL_DARKPLACES4 && cls.protocol != PROTOCOL_DARKPLACES5 && cls.protocol != PROTOCOL_DARKPLACES6)
                cl.servermovesequence = MSG_ReadLong();
        // read entity numbers until we find a 0x8000
        // (which would be remove world entity, but is actually a terminator)
diff --git a/view.c b/view.c
index dacbe7e..be9bea7 100644 (file)
--- a/view.c
+++ b/view.c
@@ -221,7 +221,7 @@ void V_ParseDamage (void)
 
        armor = MSG_ReadByte ();
        blood = MSG_ReadByte ();
-       MSG_ReadVector(from, cl.protocol);
+       MSG_ReadVector(from, cls.protocol);
 
        count = blood*0.5 + armor*0.5;
        if (count < 10)