]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/fusionreactor.qc
Merge branch 'terencehill/hud_smooth_weapon_switch' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / fusionreactor.qc
index 4f3e7cc704869257d18f23886277bb868034a45e..9b67e1db2fd714cbd0b4e972ce2380bd921d37c6 100644 (file)
@@ -34,7 +34,7 @@ bool turret_fusionreactor_firecheck()
     if (self.enemy.ammo >= self.enemy.ammo_max)
         return false;
 
-    if (vlen(self.enemy.origin - self.origin) > self.target_range)
+    if(vdist(self.enemy.origin - self.origin, >, self.target_range))
         return false;
 
     if(self.team != self.enemy.team)
@@ -46,16 +46,17 @@ bool turret_fusionreactor_firecheck()
     return true;
 }
 
-spawnfunc(turret_fusionreactor) { if (!turret_initialize(TUR_FUSIONREACTOR)) remove(self); }
+spawnfunc(turret_fusionreactor) { if (!turret_initialize(TUR_FUSIONREACTOR)) remove(this); }
 
-METHOD(FusionReactor, tr_attack, void(FusionReactor this))
+METHOD(FusionReactor, tr_attack, void(FusionReactor this, entity it))
 {
     self.enemy.ammo = min(self.enemy.ammo + self.shot_dmg,self.enemy.ammo_max);
     vector fl_org = 0.5 * (self.enemy.absmin + self.enemy.absmax);
     te_smallflash(fl_org);
 }
-METHOD(FusionReactor, tr_think, void(FusionReactor thistur))
+METHOD(FusionReactor, tr_think, void(FusionReactor thistur, entity it))
 {
+    SELFPARAM();
     self.tur_head.avelocity = '0 250 0' * (self.ammo / self.ammo_max);
 }
 METHOD(FusionReactor, tr_setup, void(FusionReactor this, entity it))