]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tturrets/system/system_aimprocs.qc
Merge remote-tracking branch 'origin/mirceakitsune/physical_entities'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / system / system_aimprocs.qc
index 99f18c20b0c545ffb42c7eb7f8cc2a240a5058e0..675b5de0db30283236ab1532de8cbf032af153ca 100644 (file)
@@ -3,41 +3,26 @@
 
 supports:
 TFL_AIM_NO
-TFL_AIM_GROUND2
+TFL_AIM_GROUNDGROUND
 TFL_AIM_LEAD
 TFL_AIM_SHOTTIMECOMPENSATE
-TFL_AIM_INFRONT
-TFL_AIM_BEHIND
-
-not supported:
-TFL_AIM_BALISTIC
-
-removed
-TFL_AIM_ZEASE
-TFL_AIM_GROUND
 */
 vector turret_stdproc_aim_generic()
 {
 
-    vector pre_pos,prep;
-    float distance,impact_time,i,mintime;
+    vector pre_pos, prep;
+    float distance, impact_time, i, mintime;
 
     turret_tag_fire_update();
 
     if(self.aim_flags & TFL_AIM_SIMPLE)
         return real_origin(self.enemy);
 
-       mintime = max(self.attack_finished_single - time,0) + sys_frametime ;
+       mintime = max(self.attack_finished_single - time,0) + sys_frametime;
 
     // Baseline
     pre_pos = real_origin(self.enemy);
 
-    if (self.aim_flags & TFL_AIM_INFRONT)   // Aim a bit in front of the target
-        pre_pos = pre_pos + (normalize(self.enemy.velocity) * 64);
-
-    if (self.aim_flags & TFL_AIM_BEHIND)    // Aim a bit behind the target
-        pre_pos = pre_pos - (normalize(self.enemy.velocity) * 32);
-
     // Lead?
     if (self.aim_flags & TFL_AIM_LEAD)
     {          
@@ -45,6 +30,9 @@ vector turret_stdproc_aim_generic()
                {
                        // FIXME: this cant be the best way to do this..
                        prep = pre_pos;
+#ifdef GMQCC
+                       impact_time = 0;
+#endif
                        for(i = 0; i < 4; ++i)
                        {
                                distance = vlen(prep - self.tur_shotorg);
@@ -63,7 +51,7 @@ vector turret_stdproc_aim_generic()
                                vz = self.enemy.velocity_z;
                                for(i = 0; i < impact_time; i += sys_frametime)
                                {
-                                       vz = vz - (sv_gravity * sys_frametime);
+                                       vz = vz - (autocvar_sv_gravity * sys_frametime);
                                        prep_z = prep_z + vz * sys_frametime;
                                }
                        }
@@ -73,7 +61,7 @@ vector turret_stdproc_aim_generic()
                        pre_pos = pre_pos + self.enemy.velocity * mintime;
     }
     
-    if(self.aim_flags & TFL_AIM_GROUND2)
+    if(self.aim_flags & TFL_AIM_GROUNDGROUND)
     {
         //tracebox(pre_pos + '0 0 32',self.enemy.mins,self.enemy.maxs,pre_pos -'0 0 64',MOVE_WORLDONLY,self.enemy);
         traceline(pre_pos + '0 0 32',pre_pos -'0 0 64',MOVE_WORLDONLY,self.enemy);