}
}
+static void SV_Physics_ClientMove_Move(prvm_edict_t *ent)
+{
+ prvm_prog_t *prog = SVVM_prog;
+ // don't do physics on disconnected clients, FrikBot relies on this
+ if (!host_client->begun)
+ {
+ memset(&host_client->cmd, 0, sizeof(host_client->cmd));
+ return;
+ }
+
+ // make sure the velocity is sane (not a NaN)
+ SV_CheckVelocity(ent);
+
+ switch ((int) PRVM_serveredictfloat(ent, movetype))
+ {
+ case MOVETYPE_PUSH:
+ case MOVETYPE_FAKEPUSH:
+ SV_Physics_Pusher (ent);
+ break;
+ case MOVETYPE_NONE:
+ break;
+ case MOVETYPE_FOLLOW:
+ SV_Physics_Follow (ent);
+ break;
+ case MOVETYPE_NOCLIP:
+ break;
+ case MOVETYPE_STEP:
+ SV_Physics_Step (ent);
+ break;
+ case MOVETYPE_WALK:
+ SV_WalkMove (ent);
+ break;
+ case MOVETYPE_TOSS:
+ case MOVETYPE_BOUNCE:
+ case MOVETYPE_BOUNCEMISSILE:
+ case MOVETYPE_FLYMISSILE:
+ // regular thinking
+ SV_Physics_Toss (ent);
+ break;
+ case MOVETYPE_FLY:
+ case MOVETYPE_FLY_WORLDONLY:
+ SV_WalkMove (ent);
+ break;
+ case MOVETYPE_PHYSICS:
+ break;
+ default:
+ Con_Printf ("SV_Physics_ClientEntity: bad movetype %i\n", (int)PRVM_serveredictfloat(ent, movetype));
+ break;
+ }
+
+ SV_CheckVelocity (ent);
+
+ SV_LinkEdict(ent);
+ //SV_LinkEdict_TouchAreaGrid(ent);
+
+ SV_CheckVelocity (ent);
+}
+
void SV_Physics_ClientMove(void)
{
prvm_prog_t *prog = SVVM_prog;
SV_CheckVelocity(ent);
// perform MOVETYPE_WALK behavior
- SV_WalkMove (ent);
+ //SV_WalkMove (ent);
+ SV_Physics_ClientMove_Move(ent);
// call standard player post-think, with frametime = 0
PRVM_serverglobalfloat(time) = sv.time;
if (ceil(max(sv_readmoves[sv_numreadmoves-1].receivetime - sv_readmoves[sv_numreadmoves-1].time, 0) * 1000.0) < sv_clmovement_minping.integer)
host_client->clmovement_disabletimeout = realtime + sv_clmovement_minping_disabletime.value / 1000.0;
// several conditions govern whether clientside movement prediction is allowed
- if (sv_readmoves[sv_numreadmoves-1].sequence && sv_clmovement_enable.integer && sv_clmovement_inputtimeout.value > 0 && host_client->clmovement_disabletimeout <= realtime && PRVM_serveredictfloat(host_client->edict, movetype) == MOVETYPE_WALK && (!PRVM_serveredictfloat(host_client->edict, disableclientprediction)))
+ if (sv_readmoves[sv_numreadmoves-1].sequence && sv_clmovement_enable.integer && sv_clmovement_inputtimeout.value > 0 && host_client->clmovement_disabletimeout <= realtime && (!PRVM_serveredictfloat(host_client->edict, disableclientprediction)))
{
// process the moves in order and ignore old ones
// but always trust the latest move