Mine
public text v1 · immutable 1.
if ( seth.value[VAR_AIMPREDICT] ){
2.
// predict back to last snapshot
3.
vec3_t dir;
4.
if( !VectorCompare( eth.entities[target].origin, vec3_origin ) &&
5.
!VectorCompare( history[target][0].trPos, vec3_origin ))
6.
{
7.
8.
9.
VectorSubtract( eth.entities[target].origin, history[target][0].trPos, dir );
10.
float s = VectorLength( dir ) * seth.value[VAR_AIMPREDICT];
11.
if( s < 50.0 ){
12.
VectorScale( dir, seth.value[VAR_AIMPREDICT], dir );
13.
//VectorNormalize2( dir, dir );
14.
VectorAdd( eth.entities[target].head_visible_pt, dir, eth.entities[target].head_visible_pt );
15.
VectorNormalize2( dir, dir );
16.
printf("Moving %i %.4f back along {%.3f, %.3f, %.3f}\n", target, s, dir[0], dir[1], dir[2] );
17.
} else
18.
printf("s too big, ignoring\n");
19.
} else
20.
printf("null, ignoring\n");
21.
//VectorCopy(eth.entities[target].head_visible_pt
22.
}