bottom[1] = top[1];
bottom[2] = top[2] - 160;
- tr = SV_TraceLine(top, bottom, MOVE_NOMONSTERS, host_client->edict, SUPERCONTENTS_SOLID);
+ tr = SV_TraceLine(top, bottom, MOVE_NOMONSTERS, host_client->edict, SUPERCONTENTS_SOLID, collision_extendmovelength.value);
// if looking at a wall, leave ideal the way is was
if (tr.startsolid)
return;
start[2] = PRVM_serveredictvector(host_client->edict, origin)[2] + PRVM_serveredictvector(host_client->edict, mins)[2];
stop[2] = start[2] - 34;
- trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, host_client->edict, SV_GenericHitSuperContentsMask(host_client->edict));
+ trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, host_client->edict, SV_GenericHitSuperContentsMask(host_client->edict), collision_extendmovelength.value);
if (trace.fraction == 1.0)
friction = sv_friction.value*sv_edgefriction.value;
static void DropPunchAngle (void)
{
prvm_prog_t *prog = SVVM_prog;
- float len;
- vec3_t v;
+ vec_t len;
+ vec3_t punchangle, punchvector;
- len = VectorNormalizeLength (PRVM_serveredictvector(host_client->edict, punchangle));
+ VectorCopy(PRVM_serveredictvector(host_client->edict, punchangle), punchangle);
+ VectorCopy(PRVM_serveredictvector(host_client->edict, punchvector), punchvector);
- len -= 10*sv.frametime;
- if (len < 0)
- len = 0;
- VectorScale (PRVM_serveredictvector(host_client->edict, punchangle), len, PRVM_serveredictvector(host_client->edict, punchangle));
+ len = VectorNormalizeLength(punchangle);
+ if (len > 0)
+ {
+ len -= 10*sv.frametime;
+ if (len < 0)
+ len = 0;
+ VectorScale(punchangle, len, punchangle);
+ }
- VectorCopy(PRVM_serveredictvector(host_client->edict, punchvector), v);
- len = VectorNormalizeLength(v);
+ len = VectorNormalizeLength(punchvector);
if (len > 0)
{
len -= 20*sv.frametime;
if (len < 0)
len = 0;
- VectorScale(v, len, v);
+ VectorScale(punchvector, len, punchvector);
}
- VectorCopy(v, PRVM_serveredictvector(host_client->edict, punchvector));
+
+ VectorCopy(punchangle, PRVM_serveredictvector(host_client->edict, punchangle));
+ VectorCopy(punchvector, PRVM_serveredictvector(host_client->edict, punchvector));
}
/*
{
prvm_prog_t *prog = SVVM_prog;
int i;
- vec3_t wishvel;
- float speed, newspeed, wishspeed, addspeed, accelspeed, temp;
+ vec3_t wishvel, v_angle;
+ vec_t speed, newspeed, wishspeed, addspeed, accelspeed, temp;
// user intentions
- AngleVectors (PRVM_serveredictvector(host_client->edict, v_angle), forward, right, up);
+ VectorCopy(PRVM_serveredictvector(host_client->edict, v_angle), v_angle);
+ AngleVectors(v_angle, forward, right, up);
for (i=0 ; i<3 ; i++)
wishvel[i] = forward[i]*cmd.forwardmove + right[i]*cmd.sidemove;
void SV_ClientThink (void)
{
prvm_prog_t *prog = SVVM_prog;
- vec3_t v_angle;
+ vec3_t v_angle, angles, velocity;
//Con_Printf("clientthink for %ims\n", (int) (sv.frametime * 1000));
// angles
// show 1/3 the pitch angle and all the roll angle
VectorAdd (PRVM_serveredictvector(host_client->edict, v_angle), PRVM_serveredictvector(host_client->edict, punchangle), v_angle);
- PRVM_serveredictvector(host_client->edict, angles)[ROLL] = V_CalcRoll (PRVM_serveredictvector(host_client->edict, angles), PRVM_serveredictvector(host_client->edict, velocity))*4;
+ VectorCopy(PRVM_serveredictvector(host_client->edict, angles), angles);
+ VectorCopy(PRVM_serveredictvector(host_client->edict, velocity), velocity);
+ PRVM_serveredictvector(host_client->edict, angles)[ROLL] = V_CalcRoll (angles, velocity)*4;
if (!PRVM_serveredictfloat(host_client->edict, fixangle))
{
PRVM_serveredictvector(host_client->edict, angles)[PITCH] = -v_angle[PITCH]/3;
if (sv_numreadmoves < 1)
return;
// only start accepting input once the player is spawned
- if (!host_client->spawned)
+ if (!host_client->begun)
return;
#if DEBUGMOVES
Con_Printf("SV_ExecuteClientMoves: read %i moves at sv.time %f\n", sv_numreadmoves, (float)sv.time);
clc_stringcmd_invalid:
Con_Printf("Received invalid stringcmd from %s\n", host_client->name);
if(developer.integer > 0)
- Com_HexDumpToConsole((unsigned char *) s, strlen(s));
+ Com_HexDumpToConsole((unsigned char *) s, (int)strlen(s));
break;
case clc_disconnect:
// if the client hasn't progressed through signons yet,
// ignore any clc_ackframes we get (they're probably from the
// previous level)
- if (host_client->spawned && host_client->latestframenum < num)
+ if (host_client->begun && host_client->latestframenum < num)
{
int i;
for (i = host_client->latestframenum + 1;i < num;i++)