]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix a turret system bug using uninitialized stuff
authorRudolf Polzer <divverent@xonotic.org>
Mon, 17 Dec 2012 16:04:46 +0000 (17:04 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 17 Dec 2012 16:04:46 +0000 (17:04 +0100)
qcsrc/server/tturrets/system/system_main.qc

index 36154fbb9800d694e6849d26609fc78c78fce6e2..891941c9304d49d1bd047ffeab692db22062778a 100644 (file)
@@ -718,9 +718,7 @@ entity turret_select_target()
     float  m_score;  // currently best scoreing target's score
 
     m_score = 0;
-    if(self.enemy)
-       if(self.enemy.takedamage)
-    if(turret_validate_target(self,self.enemy,self.target_validate_flags) > 0)
+    if(self.enemy && self.enemy.takedamage && turret_validate_target(self,self.enemy,self.target_validate_flags) > 0)
     {
         e_enemy = self.enemy;
         m_score = self.turret_score_target(self,e_enemy) * self.target_select_samebias;