+ PRVM_ExecuteProgram(prog->globals.server->PlayerPreThink, "QC function PlayerPreThink is missing");
+
+ // make sure the velocity is still sane (not a NaN)
+ SV_CheckVelocity(ent);
+}
+
+static void SV_Physics_ClientEntity_PostThink(prvm_edict_t *ent)
+{
+ // make sure the velocity is sane (not a NaN)
+ SV_CheckVelocity(ent);
+
+ // call standard player post-think
+ prog->globals.server->time = sv.time;
+ prog->globals.server->self = PRVM_EDICT_TO_PROG(ent);
+ PRVM_ExecuteProgram(prog->globals.server->PlayerPostThink, "QC function PlayerPostThink is missing");
+
+ // make sure the velocity is still sane (not a NaN)
+ SV_CheckVelocity(ent);
+
+ if(ent->fields.server->fixangle)
+ {
+ // angle fixing was requested by physics code...
+ // so store the current angles for later use
+ memcpy(host_client->fixangle_angles, ent->fields.server->angles, sizeof(host_client->fixangle_angles));
+ host_client->fixangle_angles_set = TRUE;
+
+ // and clear fixangle for the next frame
+ ent->fields.server->fixangle = 0;
+ }
+
+ // decrement the countdown variable used to decide when to go back to
+ // synchronous physics
+ if (host_client->clmovement_inputtimeout > sv.frametime)
+ host_client->clmovement_inputtimeout -= sv.frametime;
+ else
+ host_client->clmovement_inputtimeout = 0;
+}
+
+static void SV_Physics_ClientEntity(prvm_edict_t *ent)
+{
+ // don't do physics on disconnected clients, FrikBot relies on this
+ if (!host_client->spawned)
+ {
+ memset(&host_client->cmd, 0, sizeof(host_client->cmd));
+ return;
+ }
+
+ // make sure the velocity is sane (not a NaN)
+ SV_CheckVelocity(ent);