int download_expectedposition; // next position the client should ack
qboolean download_started;
char download_name[MAX_QPATH];
+
+ // fixangle data
+ qboolean fixangle_angles_set;
+ vec3_t fixangle_angles;
} client_t;
SV_SetIdealPitch (); // how much to look up / down ideally
// a fixangle might get lost in a dropped packet. Oh well.
- if ( ent->fields.server->fixangle )
+ if(ent->fields.server->fixangle)
+ {
+ // angle fixing was requested by global thinking 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;
+ }
+
+ if (host_client->fixangle_angles_set)
{
MSG_WriteByte (msg, svc_setangle);
for (i=0 ; i < 3 ; i++)
- MSG_WriteAngle (msg, ent->fields.server->angles[i], sv.protocol);
- // LordHavoc: moved fixangle = 0 to the physics code so it is
- // repeatedly sent to predicted clients even though they don't always
- // move each frame
- //ent->fields.server->fixangle = 0;
+ MSG_WriteAngle (msg, host_client->fixangle_angles[i], sv.protocol);
+ host_client->fixangle_angles_set = FALSE;
}
// stuff the sigil bits into the high bits of items for sbar, or else
void SV_Physics_ClientEntity (prvm_edict_t *ent)
{
- // LordHavoc: clear fixangle here rather than on send, because input is
- // not always received every frame from predicted clients
- ent->fields.server->fixangle = 0;
SV_ApplyClientMove();
// make sure the velocity is sane (not a NaN)
SV_CheckVelocity(ent);
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");
+
+ 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;
+ }
}
/*