added back r_speeds2, with masses of information (6 lines high), and made it print...
[xonotic/darkplaces.git] / sv_phys.c
index 06e1f40..48af07c 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -270,7 +270,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
 
                if (trace.allsolid)
                {       // entity is trapped in another solid
-                       VectorCopy (vec3_origin, ent->v.velocity);
+                       VectorClear(ent->v.velocity);
                        return 3;
                }
 
@@ -316,7 +316,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
        // cliped to another plane
                if (numplanes >= MAX_CLIP_PLANES)
                {       // this shouldn't really happen
-                       VectorCopy (vec3_origin, ent->v.velocity);
+                       VectorClear(ent->v.velocity);
                        return 3;
                }
 
@@ -348,7 +348,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
                        if (numplanes != 2)
                        {
 //                             Con_Printf ("clip velocity, numplanes == %i\n",numplanes);
-                               VectorCopy (vec3_origin, ent->v.velocity);
+                               VectorClear(ent->v.velocity);
                                return 7;
                        }
                        CrossProduct (planes[0], planes[1], dir);
@@ -362,7 +362,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
 //
                if (DotProduct (ent->v.velocity, primal_velocity) <= 0)
                {
-                       VectorCopy (vec3_origin, ent->v.velocity);
+                       VectorClear(ent->v.velocity);
                        return blocked;
                }
        }
@@ -625,7 +625,7 @@ void SV_PushRotate (edict_t *pusher, float movetime)
        for (i=0 ; i<3 ; i++)
                amove[i] = pusher->v.avelocity[i] * movetime;
 
-       VectorSubtract (vec3_origin, amove, a);
+       VectorNegate (amove, a);
        AngleVectors (a, forward, right, up);
 
        VectorCopy (pusher->v.origin, pushorigin);
@@ -923,7 +923,7 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
        trace_t steptrace;
        
        VectorCopy (ent->v.origin, oldorg);
-       VectorCopy (vec3_origin, dir);
+       VectorClear (dir);
 
        for (i=0 ; i<8 ; i++)
        {
@@ -959,7 +959,7 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
                VectorCopy (oldorg, ent->v.origin);
        }
        
-       VectorCopy (vec3_origin, ent->v.velocity);
+       VectorClear (ent->v.velocity);
        return 7;               // still not moving
 }
 
@@ -1014,8 +1014,8 @@ void SV_WalkMove (edict_t *ent)
 //
        VectorCopy (oldorg, ent->v.origin);     // back to start pos
 
-       VectorCopy (vec3_origin, upmove);
-       VectorCopy (vec3_origin, downmove);
+       VectorClear (upmove);
+       VectorClear (downmove);
        upmove[2] = STEPSIZE;
        downmove[2] = -STEPSIZE + oldvel[2]*host_frametime;
 
@@ -1116,12 +1116,14 @@ void SV_Physics_Client (edict_t *ent, int num)
        case MOVETYPE_FLY:
                if (!SV_RunThink (ent))
                        return;
+               SV_CheckWater (ent);
                SV_FlyMove (ent, host_frametime, NULL);
                break;
                
        case MOVETYPE_NOCLIP:
                if (!SV_RunThink (ent))
                        return;
+               SV_CheckWater (ent);
                VectorMA (ent->v.origin, host_frametime, ent->v.velocity, ent->v.origin);
                break;
                
@@ -1314,8 +1316,8 @@ void SV_Physics_Toss (edict_t *ent)
                {
                        ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
                        ent->v.groundentity = EDICT_TO_PROG(trace.ent);
-                       VectorCopy (vec3_origin, ent->v.velocity);
-                       VectorCopy (vec3_origin, ent->v.avelocity);
+                       VectorClear (ent->v.velocity);
+                       VectorClear (ent->v.avelocity);
                }
        }