]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/tesla.qc
spawnfunc and SendEntity3 have a 'this' parameter, use it
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / tesla.qc
index 16a9e423d3844875bf3f2bca448466f64c912e9d..35929ccc5dde1f680da289744a3671c996bc33d6 100644 (file)
@@ -1,15 +1,15 @@
 #ifndef TURRET_TESLA_H
 #define TURRET_TESLA_H
 
-#include "tesla_weapon.qc"
+#include "tesla_weapon.qh"
 
 CLASS(TeslaCoil, Turret)
 /* spawnflags */ ATTRIB(TeslaCoil, spawnflags, int, TUR_FLAG_HITSCAN | TUR_FLAG_PLAYER | TUR_FLAG_MISSILE);
 /* mins       */ ATTRIB(TeslaCoil, mins, vector, '-60 -60 0');
 /* maxs       */ ATTRIB(TeslaCoil, maxs, vector, '60 60 128');
 /* modelname  */ ATTRIB(TeslaCoil, mdl, string, "tesla_base.md3");
-/* model      */ ATTRIB(TeslaCoil, model, string, strzone(strcat("models/turrets/", this.mdl)));
-/* head_model */ ATTRIB(TeslaCoil, head_model, string, strzone(strcat("models/turrets/", "tesla_head.md3")));
+/* model      */ ATTRIB_STRZONE(TeslaCoil, model, string, strcat("models/turrets/", this.mdl));
+/* head_model */ ATTRIB_STRZONE(TeslaCoil, head_model, string, strcat("models/turrets/", "tesla_head.md3"));
 /* netname    */ ATTRIB(TeslaCoil, netname, string, "tesla");
 /* fullname   */ ATTRIB(TeslaCoil, turret_name, string, _("Tesla Coil"));
     ATTRIB(TeslaCoil, m_weapon, Weapon, WEP_TESLA);
@@ -20,14 +20,13 @@ REGISTER_TURRET(TESLA, NEW(TeslaCoil));
 
 #ifdef IMPLEMENTATION
 
-#include "tesla_weapon.qc"
-
 #ifdef SVQC
 
-spawnfunc(turret_tesla) { if (!turret_initialize(TUR_TESLA)) remove(self); }
+spawnfunc(turret_tesla) { if (!turret_initialize(TUR_TESLA)) remove(this); }
 
-METHOD(TeslaCoil, tr_think, void(TeslaCoil thistur))
+METHOD(TeslaCoil, tr_think, void(TeslaCoil thistur, entity it))
 {
+    SELFPARAM();
     if(!self.active)
     {
         self.tur_head.avelocity = '0 0 0';