float turret_validate_target(entity e_turret, entity e_target, float validate_flags)
{
vector v_tmp;
-
+
//if(!validate_flags & TFL_TARGETSELECT_NOBUILTIN)
// return -0.5;
return -0.5;
if not(checkpvs(e_target.origin, e_turret))
- return -1;
+ return -1;
if not (e_target)
return -2;
return -5;
// Cant touch this
- if (e_target.health < 0)
+ if(e_target.vehicle_flags & VHF_ISVEHICLE)
+ {
+ if (e_target.vehicle_health <= 0)
+ return -6;
+ }
+ else if (e_target.health <= 0)
return -6;
// player
{
v_tmp = real_origin(e_target) + ((e_target.mins + e_target.maxs) * 0.5);
- traceline(e_turret.tur_shotorg, v_tmp, 0, e_turret);
+ traceline(e_turret.origin + '0 0 16', v_tmp, 0, e_turret);
if (e_turret.aim_firetolerance_dist < vlen(v_tmp - trace_endpos))
return -19;
{
if(e.takedamage)
{
- if (turret_validate_target(self, e, self.target_select_flags) > 0)
+ float f = turret_validate_target(self, e, self.target_select_flags);
+ //dprint("F is: ", ftos(f), "\n");
+ if ( f > 0)
{
score = self.turret_score_target(self,e);
if ((score > m_score) && (score > 0))