//.float target_select_fov;
/// Last timestamp this turret aquierd a valid target
.float target_select_time;
-
+/// Throttle re-validation of current target
+.float target_validate_time;
/*
* Aim refers to real aiming, not gun pos (thats done by track)
*/
ent.turret_respawnhook();
}
-
/**
** updates enemy distances, predicted impact point/time
** and updated aim<->predict impact distance.
entity e;
self.nextthink = time + self.ticrate;
- //self.SendFlags = TNSF_UPDATE | TNSF_STATUS | TNSF_ANG | TNSF_AVEL;
// ONS uses somewhat backwards linking.
if (teamplay)
do_target_scan = 1;
// Old target (if any) invalid?
+ if(self.target_validate_time < time)
if (turret_validate_target(self, self.enemy, self.target_validate_flags) <= 0)
{
self.enemy = world;
+ self.target_validate_time = time + 0.5;
do_target_scan = 1;
}
void turrets_precash()
{
- //precache_model ("models/turrets/base.md3");
- //precache_model ("models/turrets/flac.md3");
- //precache_model ("models/turrets/pd_proj.md3");
- //precache_model ("models/turrets/reactor.md3");
- //precache_model ("models/turrets/mlrs_rocket.md3");
- //precache_model ("models/turrets/hellion.md3");
- //precache_model ("models/turrets/hunter2.md3");
- //precache_model ("models/turrets/hk.md3");
- //precache_model ("models/turrets/machinegun.md3");
- //precache_model ("models/turrets/rocket.md3");
- //precache_model ("models/turrets/mlrs.md3");
- //precache_model ("models/turrets/phaser.md3");
- //precache_model ("models/turrets/phaser_beam.md3");
- //precache_model ("models/turrets/plasmad.md3");
- //precache_model ("models/turrets/plasma.md3");
- //precache_model ("models/turrets/tesla_head.md3");
- //precache_model ("models/turrets/tesla_base.md3");
#ifdef TURRET_DEBUG
turrets_precache_debug_models();
#endif