Source/ThunderBeast/QuakeToon/game/g_weapon.c
static void check_dodge (edict_t *self, vec3_t start, vec3_t dir, int speed)
{
	vec3_t	end;
	vec3_t	v;
	trace_t	tr;
	float	eta;

	// easy mode only ducks one quarter the time
	if (skill->value == 0)
	{
		if (random() > 0.25)
			return;
	}
	VectorMA (start, 8192, dir, end);
	tr = gi.trace (start, NULL, NULL, end, self, MASK_SHOT);
	if ((tr.ent) && (tr.ent->svflags & SVF_MONSTER) && (tr.ent->health > 0) && (tr.ent->monsterinfo.dodge) && infront(tr.ent, self))
	{
		VectorSubtract (tr.endpos, start, v);
		eta = (VectorLength(v) - tr.ent->maxs[0]) / speed;
		tr.ent->monsterinfo.dodge (tr.ent, self, eta);
	}
}
/*
=================
check_dodge

This is a support routine used when a client is firing
a non-instant attack weapon.  It checks to see if a
monster's dodge function should be called.
=================
*/
check_dodge
This is a support routine used when a client is firing
a non-instant attack weapon.  It checks to see if a
monster's dodge function should be called.
check_dodge This is a support routine used when a client is firing a non - instant attack weapon . It checks to see if a monster ' s dodge function should be called .
static void check_dodge (edict_t *self, vec3_t start, vec3_t dir, int speed)
{
	vec3_t	end;
	vec3_t	v;
	trace_t	tr;
	float	eta;
	if (skill->value == 0)
	{
		if (random() > 0.25)
			return;
	}
	VectorMA (start, 8192, dir, end);
	tr = gi.trace (start, NULL, NULL, end, self, MASK_SHOT);
	if ((tr.ent) && (tr.ent->svflags & SVF_MONSTER) && (tr.ent->health > 0) && (tr.ent->monsterinfo.dodge) && infront(tr.ent, self))
	{
		VectorSubtract (tr.endpos, start, v);
		eta = (VectorLength(v) - tr.ent->maxs[0]) / speed;
		tr.ent->monsterinfo.dodge (tr.ent, self, eta);
	}
}
static void check_dodge ( edict_t * self , vec3_t start , vec3_t dir , int speed ) { vec3_t end ; vec3_t v ; trace_t tr ; float eta ; if ( skill -> value == 0 ) { if ( random ( ) > 0.25 ) return ; } VectorMA ( start , 8192 , dir , end ) ; tr = gi . trace ( start , NULL , NULL , end , self , MASK_SHOT ) ; if ( ( tr . ent ) && ( tr . ent -> svflags & SVF_MONSTER ) && ( tr . ent -> health > 0 ) && ( tr . ent -> monsterinfo . dodge ) && infront ( tr . ent , self ) ) { VectorSubtract ( tr . endpos , start , v ) ; eta = ( VectorLength ( v ) - tr . ent -> maxs [ 0 ] ) / speed ; tr . ent -> monsterinfo . dodge ( tr . ent , self , eta ) ; } }
check_dodge
This is a support routine used when a client is firing
a non-instant attack weapon.
check_dodge This is a support routine used when a client is firing a non - instant attack weapon .
// easy mode only ducks one quarter the time