diff options
author | Andrey Nazarov <skuller@skuller.net> | 2011-05-22 14:56:04 +0400 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2011-05-22 15:01:13 +0400 |
commit | 542b6dc12fd54fe8ccafd510891ebeed5a166e49 (patch) | |
tree | 75e83076eaf909fee0e537991aeeb8cffc3de2d9 /src | |
parent | 773b10b6ee0ccd76d384669caf68ed3861ae00f2 (diff) |
Improve old_origin fixes for decimated clients (again).
If projectile was created exactly on previous client frame, use final
origin on that frame, not initial origin. This should fix projectile
speed in that particular case.
Diffstat (limited to 'src')
-rw-r--r-- | src/sv_ents.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sv_ents.c b/src/sv_ents.c index 1f71b23..9838c66 100644 --- a/src/sv_ents.c +++ b/src/sv_ents.c @@ -358,8 +358,11 @@ fix_old_origin( client_t *client, entity_state_t *state, edict_t *ent, int e ) if( !ent->linkcount ) return; // not linked in anywhere - if( sent->create_framenum >= sv.framenum ) - return; // created this frame + if( sent->create_framenum >= sv.framenum ) { + // created this frame. unfortunate for projectiles: they will move only + // with 1/client->framediv fraction of their normal speed on the client + return; + } if( state->event == EV_PLAYER_TELEPORT && !Q2PRO_OPTIMIZE( client ) ) { // other clients will lerp from old_origin on EV_PLAYER_TELEPORT... @@ -367,7 +370,7 @@ fix_old_origin( client_t *client, entity_state_t *state, edict_t *ent, int e ) return; } - if( sent->create_framenum >= sv.framenum - client->framediv ) { + if( sent->create_framenum > sv.framenum - client->framediv ) { // created between client frames VectorCopy( sent->create_origin, state->old_origin ); return; |