]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/turret/tesla.qc
adjust max shot distance according to map size
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / turret / tesla.qc
index 7da97e7861f41161779fef6cd1e78decaf44f083..249fe18eb92042465d499a947929c672aee49fa3 100644 (file)
@@ -1,28 +1,10 @@
-#ifndef TURRET_TESLA_H
-#define TURRET_TESLA_H
-
-#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_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);
-ENDCLASS(TeslaCoil)
-REGISTER_TURRET(TESLA, NEW(TeslaCoil));
-
-#endif
+#include "tesla.qh"
 
 #ifdef IMPLEMENTATION
 
 #ifdef SVQC
 
-spawnfunc(turret_tesla) { if (!turret_initialize(this, TUR_TESLA)) remove(this); }
+spawnfunc(turret_tesla) { if (!turret_initialize(this, TUR_TESLA)) delete(this); }
 
 METHOD(TeslaCoil, tr_think, void(TeslaCoil thistur, entity it))
 {
@@ -81,7 +63,7 @@ bool turret_tesla_firecheck(entity this)
     if(this.target_validate_time < time)
     if (turret_validate_target(this, this.enemy, this.target_validate_flags) <= 0)
     {
-        this.enemy = world;
+        this.enemy = NULL;
         this.target_validate_time = time + 0.5;
         do_target_scan = 1;
     }