X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ftturrets%2Fsystem%2Fsystem_aimprocs.qc;h=fa21f1ac6613f389c1e361e1d8b86643ad058f81;hb=4566767f430d7a15f918d80b234f04c71f929b4e;hp=843af3d5ad64fad215932d91c7c25a7300febf92;hpb=40885be38d6c25f2840980fc7b8c437e52b49402;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/tturrets/system/system_aimprocs.qc b/qcsrc/server/tturrets/system/system_aimprocs.qc index 843af3d5a..fa21f1ac6 100644 --- a/qcsrc/server/tturrets/system/system_aimprocs.qc +++ b/qcsrc/server/tturrets/system/system_aimprocs.qc @@ -3,24 +3,15 @@ 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; + float distance, i, mintime; turret_tag_fire_update(); @@ -32,19 +23,14 @@ vector turret_stdproc_aim_generic() // 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) - { + { if (self.aim_flags & TFL_AIM_SHOTTIMECOMPENSATE) // Need to conpensate for shot traveltime { // FIXME: this cant be the best way to do this.. prep = pre_pos; + float impact_time = 0; for(i = 0; i < 4; ++i) { distance = vlen(prep - self.tur_shotorg); @@ -55,16 +41,16 @@ vector turret_stdproc_aim_generic() prep = pre_pos + (self.enemy.velocity * (impact_time + mintime)); if(self.aim_flags & TFL_AIM_ZPREDICT) - if not(self.enemy.flags & FL_ONGROUND) + if (!(self.enemy.flags & FL_ONGROUND)) if(self.enemy.movetype == MOVETYPE_WALK || self.enemy.movetype == MOVETYPE_TOSS || self.enemy.movetype == MOVETYPE_BOUNCE) { float vz; - prep_z = pre_pos_z; - vz = self.enemy.velocity_z; + prep.z = pre_pos.z; + vz = self.enemy.velocity.z; for(i = 0; i < impact_time; i += sys_frametime) { vz = vz - (autocvar_sv_gravity * sys_frametime); - prep_z = prep_z + vz * sys_frametime; + prep.z = prep.z + vz * sys_frametime; } } pre_pos = prep; @@ -72,8 +58,8 @@ vector turret_stdproc_aim_generic() else 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);