From: Rudolf Polzer Date: Mon, 17 Dec 2012 16:04:46 +0000 (+0100) Subject: fix a turret system bug using uninitialized stuff X-Git-Tag: xonotic-v0.7.0~181 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2e8f3286cbd36eadba3d39430913fdb1036ce20c;p=xonotic%2Fxonotic-data.pk3dir.git fix a turret system bug using uninitialized stuff --- diff --git a/qcsrc/server/tturrets/system/system_main.qc b/qcsrc/server/tturrets/system/system_main.qc index 36154fbb9..891941c93 100644 --- a/qcsrc/server/tturrets/system/system_main.qc +++ b/qcsrc/server/tturrets/system/system_main.qc @@ -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;