Source/ThunderBeast/QuakeToonProto1/client/cl_ents.c
void CL_DeltaEntity (frame_t *frame, int newnum, entity_state_t *old, int bits)
{
	centity_t	*ent;
	entity_state_t	*state;

	ent = &cl_entities[newnum];

	state = &cl_parse_entities[cl.parse_entities & (MAX_PARSE_ENTITIES-1)];
	cl.parse_entities++;
	frame->num_entities++;

	CL_ParseDelta (old, state, newnum, bits);

	// some data changes will force no lerping
	if (state->modelindex != ent->current.modelindex
		|| state->modelindex2 != ent->current.modelindex2
		|| state->modelindex3 != ent->current.modelindex3
		|| state->modelindex4 != ent->current.modelindex4
		|| abs(state->origin[0] - ent->current.origin[0]) > 512
		|| abs(state->origin[1] - ent->current.origin[1]) > 512
		|| abs(state->origin[2] - ent->current.origin[2]) > 512
		|| state->event == EV_PLAYER_TELEPORT
		|| state->event == EV_OTHER_TELEPORT
		)
	{
		ent->serverframe = -99;
	}

	if (ent->serverframe != cl.frame.serverframe - 1)
	{	// wasn't in last update, so initialize some things
		ent->trailcount = 1024;		// for diminishing rocket / grenade trails
		// duplicate the current state so lerping doesn't hurt anything
		ent->prev = *state;
		if (state->event == EV_OTHER_TELEPORT)
		{
			VectorCopy (state->origin, ent->prev.origin);
			VectorCopy (state->origin, ent->lerp_origin);
		}
		else
		{
			VectorCopy (state->old_origin, ent->prev.origin);
			VectorCopy (state->old_origin, ent->lerp_origin);
		}
	}
	else
	{	// shuffle the last state to previous
		ent->prev = ent->current;
	}

	ent->serverframe = cl.frame.serverframe;
	ent->current = *state;
}
/*
==================
CL_DeltaEntity

Parses deltas from the given base and adds the resulting entity
to the current frame
==================
*/
CL_DeltaEntity
Parses deltas from the given base and adds the resulting entity
to the current frame
CL_DeltaEntity Parses deltas from the given base and adds the resulting entity to the current frame
void CL_DeltaEntity (frame_t *frame, int newnum, entity_state_t *old, int bits)
{
	centity_t	*ent;
	entity_state_t	*state;
	ent = &cl_entities[newnum];
	state = &cl_parse_entities[cl.parse_entities & (MAX_PARSE_ENTITIES-1)];
	cl.parse_entities++;
	frame->num_entities++;
	CL_ParseDelta (old, state, newnum, bits);
	if (state->modelindex != ent->current.modelindex
		|| state->modelindex2 != ent->current.modelindex2
		|| state->modelindex3 != ent->current.modelindex3
		|| state->modelindex4 != ent->current.modelindex4
		|| abs(state->origin[0] - ent->current.origin[0]) > 512
		|| abs(state->origin[1] - ent->current.origin[1]) > 512
		|| abs(state->origin[2] - ent->current.origin[2]) > 512
		|| state->event == EV_PLAYER_TELEPORT
		|| state->event == EV_OTHER_TELEPORT
		)
	{
		ent->serverframe = -99;
	}
	if (ent->serverframe != cl.frame.serverframe - 1)
	{	
		ent->trailcount = 1024;		
		ent->prev = *state;
		if (state->event == EV_OTHER_TELEPORT)
		{
			VectorCopy (state->origin, ent->prev.origin);
			VectorCopy (state->origin, ent->lerp_origin);
		}
		else
		{
			VectorCopy (state->old_origin, ent->prev.origin);
			VectorCopy (state->old_origin, ent->lerp_origin);
		}
	}
	else
	{	
		ent->prev = ent->current;
	}
	ent->serverframe = cl.frame.serverframe;
	ent->current = *state;
}
void CL_DeltaEntity ( frame_t * frame , int newnum , entity_state_t * old , int bits ) { centity_t * ent ; entity_state_t * state ; ent = & cl_entities [ newnum ] ; state = & cl_parse_entities [ cl . parse_entities & ( MAX_PARSE_ENTITIES - 1 ) ] ; cl . parse_entities ++ ; frame -> num_entities ++ ; CL_ParseDelta ( old , state , newnum , bits ) ; if ( state -> modelindex != ent -> current . modelindex || state -> modelindex2 != ent -> current . modelindex2 || state -> modelindex3 != ent -> current . modelindex3 || state -> modelindex4 != ent -> current . modelindex4 || abs ( state -> origin [ 0 ] - ent -> current . origin [ 0 ] ) > 512 || abs ( state -> origin [ 1 ] - ent -> current . origin [ 1 ] ) > 512 || abs ( state -> origin [ 2 ] - ent -> current . origin [ 2 ] ) > 512 || state -> event == EV_PLAYER_TELEPORT || state -> event == EV_OTHER_TELEPORT ) { ent -> serverframe = -99 ; } if ( ent -> serverframe != cl . frame . serverframe - 1 ) { ent -> trailcount = 1024 ; ent -> prev = * state ; if ( state -> event == EV_OTHER_TELEPORT ) { VectorCopy ( state -> origin , ent -> prev . origin ) ; VectorCopy ( state -> origin , ent -> lerp_origin ) ; } else { VectorCopy ( state -> old_origin , ent -> prev . origin ) ; VectorCopy ( state -> old_origin , ent -> lerp_origin ) ; } } else { ent -> prev = ent -> current ; } ent -> serverframe = cl . frame . serverframe ; ent -> current = * state ; }
CL_DeltaEntity
Parses deltas from the given base and adds the resulting entity
to the current frame
CL_DeltaEntity Parses deltas from the given base and adds the resulting entity to the current frame
// some data changes will force no lerping // wasn't in last update, so initialize some things // for diminishing rocket / grenade trails // duplicate the current state so lerping doesn't hurt anything // shuffle the last state to previous