]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tturrets/system/system_scoreprocs.qc
Merge branch 'master' into Mario/monsters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / system / system_scoreprocs.qc
index 05717bf184dab0401ec6bc21c1417772185a0827..223f8eacf388f64a8e88d3d9ed08bf378a57b720 100644 (file)
@@ -1,7 +1,7 @@
 float turret_stdproc_targetscore_support(entity _turret,entity _target)
 {
     float score;        // Total score
-    float s_score, d_score;
+    float s_score = 0, d_score;
 
     if (_turret.enemy == _target) s_score = 1;
 
@@ -22,8 +22,8 @@ float turret_stdproc_targetscore_generic(entity _turret, entity _target)
     float score;        // Total score
     float d_score;      // Distance score
     float a_score;      // Angular score
-    float m_score;      // missile score
-    float p_score;      // player score
+    float m_score = 0;  // missile score
+    float p_score = 0;  // player score
     float ikr;          // ideal kill range
 
     if (_turret.tur_defend)
@@ -44,7 +44,10 @@ float turret_stdproc_targetscore_generic(entity _turret, entity _target)
     if ((_turret.target_select_missilebias > 0) && (_target.flags & FL_PROJECTILE))
         m_score = 1;
 
-    if ((_turret.target_select_playerbias > 0) && (_target.flags & FL_CLIENT))
+    if ((_turret.target_select_playerbias > 0) && IS_CLIENT(_target) && !g_td)
+        p_score = 1;
+        
+    if(g_td && _target.flags & FL_MONSTER)
         p_score = 1;
 
     d_score = max(d_score, 0);