]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_user.c
disable hidden surface removal by default
[xonotic/darkplaces.git] / sv_user.c
index 1fc07731ced69ea27b87da15c09a5daab60348fb..30a654a7b79943530c76c76cf812a31645b0f0e6 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -72,7 +72,7 @@ void SV_SetIdealPitch (void)
                top[0] = sv_player->v.origin[0] + cosval*(i+3)*12;
                top[1] = sv_player->v.origin[1] + sinval*(i+3)*12;
                top[2] = sv_player->v.origin[2] + sv_player->v.view_ofs[2];
-               
+
                bottom[0] = top[0];
                bottom[1] = top[1];
                bottom[2] = top[2] - 160;
@@ -150,7 +150,7 @@ void SV_UserFriction (void)
 // apply friction      
        control = speed < sv_stopspeed.value ? sv_stopspeed.value : speed;
        newspeed = speed - sv.frametime*control*friction;
-       
+
        if (newspeed < 0)
                newspeed = 0;
        else
@@ -166,27 +166,6 @@ void SV_UserFriction (void)
 SV_Accelerate
 ==============
 */
-#if 0
-void SV_Accelerate (vec3_t wishvel)
-{
-       int                     i;
-       float           addspeed, accelspeed;
-       vec3_t          pushvec;
-
-       if (wishspeed == 0)
-               return;
-
-       VectorSubtract (wishvel, velocity, pushvec);
-       addspeed = VectorNormalize (pushvec);
-
-       accelspeed = sv_accelerate.value*sv.frametime*addspeed;
-       if (accelspeed > addspeed)
-               accelspeed = addspeed;
-       
-       for (i=0 ; i<3 ; i++)
-               velocity[i] += accelspeed*pushvec[i];   
-}
-#endif
 void SV_Accelerate (void)
 {
        int                     i;
@@ -216,7 +195,6 @@ void SV_AirAccelerate (vec3_t wishveloc)
        addspeed = wishspd - currentspeed;
        if (addspeed <= 0)
                return;
-//     accelspeed = sv_accelerate.value * sv.frametime;
        accelspeed = sv_accelerate.value*wishspeed * sv.frametime;
        if (accelspeed > addspeed)
                accelspeed = addspeed;
@@ -274,7 +252,7 @@ void SV_WaterMove (void)
        else
                wishvel[2] += cmd.upmove;
 
-       wishspeed = Length(wishvel);
+       wishspeed = VectorLength(wishvel);
        if (wishspeed > sv_maxspeed.value)
        {
                temp = sv_maxspeed.value/wishspeed;
@@ -286,7 +264,7 @@ void SV_WaterMove (void)
 //
 // water friction
 //
-       speed = Length (velocity);
+       speed = VectorLength (velocity);
        if (speed)
        {
                newspeed = speed - sv.frametime * speed * sv_friction.value;
@@ -346,7 +324,6 @@ void SV_AirMove (void)
        wishvel[0] = wishvel[2] = 0;
        wishvel[1] = sv_player->v.angles[1];
        AngleVectors (wishvel, forward, right, up);
-//     AngleVectors (sv_player->v.angles, forward, right, up);
 
        fmove = cmd.forwardmove;
        smove = cmd.sidemove;
@@ -384,7 +361,7 @@ void SV_AirMove (void)
        else
        {       // not on ground, so little effect on velocity
                SV_AirAccelerate (wishvel);
-       }               
+       }
 }
 
 /*
@@ -447,7 +424,7 @@ void SV_ClientThink (void)
                return;
        }
 
-       SV_AirMove ();  
+       SV_AirMove ();
 }
 
 
@@ -463,7 +440,7 @@ void SV_ReadClientMove (usercmd_t *move)
        int             bits;
        eval_t  *val;
        float   total;
-       
+
 // read ping time
        host_client->ping_times[host_client->num_pings % NUM_PING_TIMES] = sv.time - MSG_ReadFloat ();
        host_client->num_pings++;
@@ -477,12 +454,12 @@ void SV_ReadClientMove (usercmd_t *move)
                val->_float = host_client->ping * 1000.0;
 
 // read current angles
-       // dpprotocol
-       for (i=0 ; i<3 ; i++)
-               angle[i] = MSG_ReadPreciseAngle ();
+       // dpprotocol version 2
+       for (i = 0;i < 3;i++)
+               angle[i] = MSG_ReadFloat ();
 
        VectorCopy (angle, host_client->edict->v.v_angle);
-               
+
 // read movement
        move->forwardmove = MSG_ReadShort ();
        move->sidemove = MSG_ReadShort ();
@@ -493,7 +470,7 @@ void SV_ReadClientMove (usercmd_t *move)
                val->vector[1] = move->sidemove;
                val->vector[2] = move->upmove;
        }
-       
+
 // read buttons
        bits = MSG_ReadByte ();
        host_client->edict->v.button0 = bits & 1;
@@ -518,6 +495,7 @@ SV_ReadClientMessage
 Returns false if the client should be killed
 ===================
 */
+void SV_SendServerinfo (client_t *client);
 qboolean SV_ReadClientMessage (void)
 {
        int             ret;
@@ -547,24 +525,31 @@ nextmsg:
                        {
                                Sys_Printf ("SV_ReadClientMessage: badread\n");
                                return false;
-                       }       
-       
+                       }
+
                        cmd = MSG_ReadChar ();
-                       
+
+#ifndef NOROUTINGFIX
+                       if (cmd != -1 && host_client->waitingforconnect)
+                       {
+                               host_client->waitingforconnect = false;
+                               host_client->sendserverinfo = true;
+                       }
+#endif
+
                        switch (cmd)
                        {
                        case -1:
                                goto nextmsg;           // end of message
-                               
+
                        default:
                                Sys_Printf ("SV_ReadClientMessage: unknown command char %i\n", cmd);
                                return false;
-                                                       
+
                        case clc_nop:
-//                             Sys_Printf ("clc_nop\n");
                                break;
-                               
-                       case clc_stringcmd:     
+
+                       case clc_stringcmd:
                                s = MSG_ReadString ();
                                ret = 0;
                                if (Q_strncasecmp(s, "status", 6) == 0
@@ -590,18 +575,9 @@ nextmsg:
                                }
                                else
                                        Con_DPrintf("%s tried to %s\n", host_client->name, s);
-                               /*
-                               if (ret == 2)
-                                       Cbuf_InsertText (s);
-                               else if (ret == 1)
-                                       Cmd_ExecuteString (s, src_client);
-                               else
-                                       Con_DPrintf("%s tried to %s\n", host_client->name, s);
-                               */
                                break;
 
                        case clc_disconnect:
-//                             Sys_Printf ("SV_ReadClientMessage: client disconnected\n");
                                return false;
 
                        case clc_move: