]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/fusionreactor.qc
Add attacker parameter to PlayHitsound
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / fusionreactor.qc
index 013c089f3cf4a4a606988d19d7202e5748e1eb5d..47bff24f1a9e063661ab21e75eb5c14b528b1cd6 100644 (file)
@@ -8,7 +8,7 @@ CLASS(FusionReactor, Turret)
 /* modelname  */ ATTRIB(FusionReactor, mdl, string, "base.md3");
 /* model      */ ATTRIB_STRZONE(FusionReactor, model, string, strcat("models/turrets/", this.mdl));
 /* head_model */ ATTRIB_STRZONE(FusionReactor, head_model, string, strcat("models/turrets/", "reactor.md3"));
-/* netname    */ ATTRIB(FusionReactor, netname, string, "fusionreactor");
+/* netname    */ ATTRIB(FusionReactor, netname, string, "fusreac");
 /* fullname   */ ATTRIB(FusionReactor, turret_name, string, _("Fusion Reactor"));
 ENDCLASS(FusionReactor)
 REGISTER_TURRET(FUSIONREACTOR, NEW(FusionReactor));
@@ -25,7 +25,7 @@ bool turret_fusionreactor_firecheck(entity this)
     if (IS_DEAD(this.enemy))
         return false;
 
-    if (this.enemy == world)
+    if (this.enemy == NULL)
         return false;
 
     if (this.ammo < this.shot_dmg)
@@ -46,12 +46,12 @@ bool turret_fusionreactor_firecheck(entity this)
     return true;
 }
 
-spawnfunc(turret_fusionreactor) { if (!turret_initialize(this, TUR_FUSIONREACTOR)) remove(this); }
+spawnfunc(turret_fusionreactor) { if (!turret_initialize(this, TUR_FUSIONREACTOR)) delete(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);
+    it.enemy.ammo = min(it.enemy.ammo + it.shot_dmg,it.enemy.ammo_max);
+    vector fl_org = 0.5 * (it.enemy.absmin + it.enemy.absmax);
     te_smallflash(fl_org);
 }
 METHOD(FusionReactor, tr_think, void(FusionReactor thistur, entity it))