#include "sv_demo.h"
#define DEBUGMOVES 0
-static usercmd_t cmd;
+static usercmd_t usercmd;
extern cvar_t sv_autodemo_perclient;
+extern cvar_t sv_rollangle;
+extern cvar_t sv_rollspeed;
/*
==================
PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(host_client->edict);
prog->ExecuteProgram(prog, PRVM_serverfunction(ClientConnect), "QC function ClientConnect is missing");
- if (cls.state == ca_dedicated)
- Con_Printf("%s connected\n", host_client->name);
+ Con_Printf("%s connected\n", host_client->name);
PRVM_serverglobalfloat(time) = sv.time;
prog->ExecuteProgram(prog, PRVM_serverfunction(PutClientInServer), "QC function PutClientInServer is missing");
static vec3_t wishdir, forward, right, up;
static float wishspeed;
-static qboolean onground;
+static qbool onground;
/*
==================
AngleVectors(v_angle, forward, right, up);
for (i=0 ; i<3 ; i++)
- wishvel[i] = forward[i]*cmd.forwardmove + right[i]*cmd.sidemove;
+ wishvel[i] = forward[i]*usercmd.forwardmove + right[i]*usercmd.sidemove;
- if (!cmd.forwardmove && !cmd.sidemove && !cmd.upmove)
+ if (!usercmd.forwardmove && !usercmd.sidemove && !usercmd.upmove)
wishvel[2] -= 60; // drift towards bottom
else
- wishvel[2] += cmd.upmove;
+ wishvel[2] += usercmd.upmove;
fwishspeed = VectorLength(wishvel);
if (fwishspeed > sv_maxspeed.value)
wishvel[1] = PRVM_serveredictvector(host_client->edict, angles)[1];
AngleVectors (wishvel, forward, right, up);
- fmove = cmd.forwardmove;
- smove = cmd.sidemove;
+ fmove = usercmd.forwardmove;
+ smove = usercmd.sidemove;
// hack to not let you back into teleporter
if (sv.time < PRVM_serveredictfloat(host_client->edict, teleport_time) && fmove < 0)
wishvel[i] = forward[i]*fmove + right[i]*smove;
if ((int)PRVM_serveredictfloat(host_client->edict, movetype) != MOVETYPE_WALK)
- wishvel[2] += cmd.upmove;
+ wishvel[2] += usercmd.upmove;
VectorCopy (wishvel, wishdir);
wishspeed = VectorNormalizeLength(wishdir);
if (PRVM_serveredictfloat(host_client->edict, health) <= 0)
return;
- cmd = host_client->cmd;
+ usercmd = host_client->cmd;
// 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);
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;
+ PRVM_serveredictvector(host_client->edict, angles)[ROLL] = Com_CalcRoll (angles, velocity, sv_rollangle.value, sv_rollspeed.value)*4;
if (!PRVM_serveredictfloat(host_client->edict, fixangle))
{
PRVM_serveredictvector(host_client->edict, angles)[PITCH] = -v_angle[PITCH]/3;
PRVM_serveredictfloat(host_client->edict, ping_movementloss) = movementloss / (float) NETGRAPH_PACKETS;
}
-static qboolean SV_FrameLost(int framenum)
+static qbool SV_FrameLost(int framenum)
{
if (host_client->entitydatabase5)
{