]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Turrets: prepare for upgrade
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 28 Sep 2015 05:55:53 +0000 (15:55 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 28 Sep 2015 06:02:28 +0000 (16:02 +1000)
16 files changed:
qcsrc/common/turrets/all.qh
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/turret.qh
qcsrc/common/turrets/turret/ewheel.qc
qcsrc/common/turrets/turret/flac.qc
qcsrc/common/turrets/turret/fusionreactor.qc
qcsrc/common/turrets/turret/hellion.qc
qcsrc/common/turrets/turret/hk.qc
qcsrc/common/turrets/turret/machinegun.qc
qcsrc/common/turrets/turret/mlrs.qc
qcsrc/common/turrets/turret/phaser.qc
qcsrc/common/turrets/turret/plasma.qc
qcsrc/common/turrets/turret/plasma_dual.qc
qcsrc/common/turrets/turret/tesla.qc
qcsrc/common/turrets/turret/walker.qc

index 3e4af08f63931d40b8de1868bb39fb595c4bfe75..1a464c1268bf435c7bfe1dbf3dc151866d845612 100644 (file)
@@ -3,48 +3,51 @@
 
 #include "turret.qh"
 
-void register_turret(entity e, float(float) func, float turretflags, vector min_s, vector max_s, string modelname, string headmodelname, string shortname, string mname);
+void register_turret(Turret e, bool(Turret, int) func, float turretflags, vector min_s, vector max_s, string modelname, string headmodelname, string shortname, string mname);
 
 const int TUR_MAXCOUNT = 24;
 entity turret_info[TUR_MAXCOUNT], turret_info_first, turret_info_last;
 float TUR_COUNT;
 
 #define _REGISTER_TURRET(id, func, turretflags, min_s, max_s, modelname, headmodelname, shortname, mname) \
-       float func(float); \
+       bool func(Turret, int); \
        REGISTER(RegisterTurrets, TUR, turret_info, TUR_COUNT, id, m_id, NEW(Turret)) { \
                register_turret(this, func,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname); \
        }
 void RegisterTurrets();
 REGISTER_REGISTRY(RegisterTurrets)
 
+#define REGISTER_TURRET(...) EVAL(OVERLOAD(REGISTER_TURRET, __VA_ARGS__))
+
+#define REGISTER_TURRET_2(id, inst) REGISTER(RegisterTurrets, TUR, turret_info, TUR_COUNT, id, m_id, inst)
+
 #ifdef MENUQC
-#define REGISTER_TURRET(id,func,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname) \
-       _REGISTER_TURRET(id,t_null,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname)
+#define REGISTER_TURRET_9(id,func,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname) \
+       _REGISTER_TURRET(id,t_new,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname)
 #else
-#define REGISTER_TURRET(id,func,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname) \
+#define REGISTER_TURRET_9(id,func,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname) \
        _REGISTER_TURRET(id,func,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname)
 #endif
 
-void register_turret(Turret e, float(float) func, float turretflags, vector min_s, vector max_s, string modelname, string headmodelname, string shortname, string mname)
+void register_turret(Turret e, bool(Turret, int) func, float turretflags, vector min_s, vector max_s, string modelname, string headmodelname, string shortname, string mname)
 {
        e.classname = "turret_info";
-       e.turretid = e.m_id;
-       e.netname = shortname;
-       e.turret_name = mname;
+
        e.turret_func = func;
-       e.mdl = modelname;
-       e.cvar_basename = shortname;
        e.spawnflags = turretflags;
        e.mins = min_s;
        e.maxs = max_s;
+       e.mdl = modelname;
        e.model = strzone(strcat("models/turrets/", modelname));
        e.head_model = strzone(strcat("models/turrets/", headmodelname));
+       e.netname = shortname;
+       e.turret_name = mname;
 }
 
 entity get_turretinfo(int id);
 
 REGISTER_TURRET(Null,
-       t_null,
+       t_new,
        0,
        '-0 -0 -0',
        '0 0 0',
index 94fb4ae3f4f7c64289f42975cb0aed56dc417624..3de0e95b1ddfa90f00fd89dd56448810faefa375 100644 (file)
@@ -84,7 +84,7 @@ void turret_draw2d()
                o_z = 0;
                if(hud != HUD_NORMAL)
                {
-                       if((get_turretinfo(self.turretid)).spawnflags & TUR_FLAG_MOVE)
+                       if((get_turretinfo(self.m_id)).spawnflags & TUR_FLAG_MOVE)
                                txt = "gfx/vehicles/turret_moving.tga";
                        else
                                txt = "gfx/vehicles/turret_stationary.tga";
@@ -203,12 +203,12 @@ void turret_draw2d()
 
 void turret_construct()
 {SELFPARAM();
-       entity tur = get_turretinfo(self.turretid);
+       entity tur = get_turretinfo(self.m_id);
 
        if(self.tur_head == world)
                self.tur_head = spawn();
 
-       self.netname = TUR_NAME(self.turretid);
+       self.netname = TUR_NAME(self.m_id);
 
        setorigin(self, self.origin);
        _setmodel(self, tur.model);
@@ -216,7 +216,7 @@ void turret_construct()
        setsize(self, tur.mins, tur.maxs);
        setsize(self.tur_head, '0 0 0', '0 0 0');
 
-       if(self.turretid == TUR_EWHEEL.m_id)
+       if(self.m_id == TUR_EWHEEL.m_id)
                setattachment(self.tur_head, self, "");
        else
                setattachment(self.tur_head, self, "tag_head");
@@ -241,7 +241,7 @@ void turret_construct()
        self.teamradar_color = '1 0 0';
        self.alpha = 1;
 
-       TUR_ACTION(self.turretid, TR_SETUP);
+       TUR_ACTION(self.m_id, TR_SETUP);
 }
 
 entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, float _explode);
@@ -323,12 +323,12 @@ void turret_die()
        if (!autocvar_cl_nogibs)
        {
                // Base
-               if(self.turretid == TUR_EWHEEL.m_id)
-                       turret_gibtoss((get_turretinfo(self.turretid)).model, self.origin + '0 0 18', self.velocity + '0 0 400' + '0.1 0.1 1' * (random() * 400), '-1 -1 -1', true);
-               else if (self.turretid == TUR_WALKER.m_id)
-                       turret_gibtoss((get_turretinfo(self.turretid)).model, self.origin + '0 0 18', self.velocity + '0 0 300' + '0.1 0.1 1' * (random() * 200), '-1 -1 -1', true);
-               else if (self.turretid == TUR_TESLA.m_id)
-                       turret_gibtoss((get_turretinfo(self.turretid)).model, self.origin + '0 0 18', '0 0 200', '-1 -1 -1', false);
+               if(self.m_id == TUR_EWHEEL.m_id)
+                       turret_gibtoss((get_turretinfo(self.m_id)).model, self.origin + '0 0 18', self.velocity + '0 0 400' + '0.1 0.1 1' * (random() * 400), '-1 -1 -1', true);
+               else if (self.m_id == TUR_WALKER.m_id)
+                       turret_gibtoss((get_turretinfo(self.m_id)).model, self.origin + '0 0 18', self.velocity + '0 0 300' + '0.1 0.1 1' * (random() * 200), '-1 -1 -1', true);
+               else if (self.m_id == TUR_TESLA.m_id)
+                       turret_gibtoss((get_turretinfo(self.m_id)).model, self.origin + '0 0 18', '0 0 200', '-1 -1 -1', false);
                else
                {
                        if (random() > 0.5)
@@ -340,7 +340,7 @@ void turret_die()
                        else
                                turret_gibtoss("models/turrets/base-gib1.md3", self.origin + '0 0 8', '0 0 0', '0 0 0', true);
 
-                       entity headgib = turret_gibtoss((get_turretinfo(self.turretid)).head_model, self.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', true);
+                       entity headgib = turret_gibtoss((get_turretinfo(self.m_id)).head_model, self.origin + '0 0 32', '0 0 200' + randomvec() * 200, '-1 -1 -1', true);
                        if(headgib)
                        {
                                headgib.angles = headgib.move_angles = self.tur_head.angles;
@@ -362,7 +362,7 @@ void ent_turret()
 
        if(sf & TNSF_SETUP)
        {
-               self.turretid = ReadByte();
+               self.m_id = ReadByte();
 
                self.origin_x = ReadCoord();
                self.origin_y = ReadCoord();
index 337b2789ac8e0211edb9e6e1b090f116607025b4..d8e94560cd7d8f7cf86ec44f566a8868c7cc4bf4 100644 (file)
@@ -190,7 +190,7 @@ void turret_die()
 
        if(self.damage_flags & TFL_DMG_DEATH_NORESPAWN)
        {
-               TUR_ACTION(self.turretid, TR_DEATH);
+               TUR_ACTION(self.m_id, TR_DEATH);
 
                remove(self.tur_head);
                remove(self);
@@ -202,7 +202,7 @@ void turret_die()
                self.nextthink   = time + 0.2;
                self.think               = turret_hide;
 
-               TUR_ACTION(self.turretid, TR_DEATH);
+               TUR_ACTION(self.m_id, TR_DEATH);
        }
 }
 
@@ -275,7 +275,7 @@ void turret_respawn()
 
        self.SendFlags = TNSF_FULL_UPDATE;
 
-       TUR_ACTION(self.turretid, TR_SETUP);
+       TUR_ACTION(self.m_id, TR_SETUP);
 }
 
 
@@ -304,7 +304,7 @@ float turret_send(entity to, float sf)
        WriteByte(MSG_ENTITY, sf);
        if(sf & TNSF_SETUP)
        {
-               WriteByte(MSG_ENTITY, self.turretid);
+               WriteByte(MSG_ENTITY, self.m_id);
 
                WriteCoord(MSG_ENTITY, self.origin_x);
                WriteCoord(MSG_ENTITY, self.origin_y);
@@ -358,8 +358,9 @@ float turret_send(entity to, float sf)
        return true;
 }
 
-void load_unit_settings(entity ent, string unitname, float is_reload)
+void load_unit_settings(entity ent, float is_reload)
 {SELFPARAM();
+       string unitname = ent.netname;
        string sbase;
 
        if (ent == world)
@@ -419,7 +420,7 @@ void load_unit_settings(entity ent, string unitname, float is_reload)
        ent.track_blendrate  = cvar(strcat(sbase,"_track_blendrate"));
 
        if(is_reload)
-               TUR_ACTION(self.turretid, TR_SETUP);
+               TUR_ACTION(self.m_id, TR_SETUP);
 }
 
 void turret_projectile_explode()
@@ -989,7 +990,7 @@ void turret_fire()
        if(MUTATOR_CALLHOOK(TurretFire, self))
                return;
 
-       TUR_ACTION(self.turretid, TR_ATTACK);
+       TUR_ACTION(self.m_id, TR_ATTACK);
 
        self.attack_finished_single = time + self.shot_refire;
        self.ammo -= self.shot_dmg;
@@ -1117,7 +1118,7 @@ void turret_think()
                                if (turret_checkfire())
                                        turret_fire();
 
-                               TUR_ACTION(self.turretid, TR_THINK);
+                               TUR_ACTION(self.m_id, TR_THINK);
 
                                return;
                        }
@@ -1155,7 +1156,7 @@ void turret_think()
                        if(!(self.track_flags & TFL_TRACK_NO))
                                turret_track();
 
-                       TUR_ACTION(self.turretid, TR_THINK);
+                       TUR_ACTION(self.m_id, TR_THINK);
 
                        // And bail.
                        return;
@@ -1178,7 +1179,7 @@ void turret_think()
                        turret_fire();
        }
 
-       TUR_ACTION(self.turretid, TR_THINK);
+       TUR_ACTION(self.m_id, TR_THINK);
 }
 
 /*
@@ -1218,8 +1219,8 @@ void turrets_manager_think()
                {
                        if (IS_TURRET(e))
                        {
-                               load_unit_settings(e,e.cvar_basename,1);
-                               TUR_ACTION(self.turretid, TR_THINK);
+                               load_unit_settings(e,1);
+                               TUR_ACTION(self.m_id, TR_THINK);
                        }
 
                        e = nextent(e);
@@ -1235,7 +1236,7 @@ float turret_initialize(float tur_id)
 
        entity e;
        entity tur = get_turretinfo(tur_id);
-       if(tur.turretid == 0)
+       if(tur.m_id == 0)
                return false; // invalid turret
 
        if(!self.tur_head) { TUR_ACTION(tur_id, TR_PRECACHE); } // if tur_head exists, we can assume this turret re-spawned
@@ -1252,8 +1253,8 @@ float turret_initialize(float tur_id)
        if(!(self.spawnflags & TSF_SUSPENDED))
                builtin_droptofloor();
 
-       self.cvar_basename = tur.cvar_basename;
-       load_unit_settings(self, self.cvar_basename, 0);
+       self.netname = tur.netname;
+       load_unit_settings(self, 0);
 
        if(!self.team || !teamplay)             { self.team = MAX_SHOT_DISTANCE; }
        if(!self.ticrate)                               { self.ticrate = ((self.turret_flags & TUR_FLAG_SUPPORT) ? 0.2 : 0.1); }
@@ -1330,7 +1331,7 @@ float turret_initialize(float tur_id)
        _setmodel(self, tur.model);
        setsize(self, tur.mins, tur.maxs);
 
-       self.turretid                           = tur_id;
+       self.m_id                                       = tur_id;
        self.classname                          = "turret_main";
        self.active                                     = ACTIVE_ACTIVE;
        self.effects                            = EF_NODRAW;
index e31d93fd2cbeace6c404fd91f840752f5f80d988..17cf20c7387e935d26fc4e3b9a9140ac6941d2b6 100644 (file)
@@ -1,14 +1,6 @@
 #ifndef TURRET_H
 #define TURRET_H
 
-// turret requests
-const int TR_SETUP = 1; // (BOTH) setup turret data
-const int TR_THINK = 2; // (SERVER) logic to run every frame
-const int TR_DEATH = 3; // (SERVER) called when turret dies
-const int TR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this turret
-const int TR_ATTACK = 5; // (SERVER) called when turret attacks
-const int TR_CONFIG = 6; // (ALL)
-
 // functions:
 entity get_turretinfo(int id);
 
@@ -134,29 +126,27 @@ const int TNSF_FULL_UPDATE  = 16777215;
 
 
 // other useful macros
-#define TUR_ACTION(turrettype,mrequest) (get_turretinfo(turrettype)).turret_func(mrequest)
+#define _TUR_ACTION(tur, mrequest) tur.turret_func(tur, mrequest)
+#define TUR_ACTION(tur, mrequest) _TUR_ACTION(get_turretinfo(tur), mrequest)
 #define TUR_NAME(turrettype) (get_turretinfo(turrettype)).turret_name
 
-float t_null(float dummy) { return 0; }
+bool t_new(entity this, int req);
 
 CLASS(Turret, Object)
     ATTRIB(Turret, m_id, int, 0)
 
-    ATTRIB(Turret, turretid, int, 0)
     /** short name */
     ATTRIB(Turret, netname, string, string_null)
     /** human readable name */
     ATTRIB(Turret, turret_name, string, string_null)
     /** t_... */
-    ATTRIB(Turret, turret_func, float(float), t_null)
+    ATTRIB(Turret, turret_func, float(Turret, int), t_new)
     /** currently a copy of the model */
     ATTRIB(Turret, mdl, string, string_null)
     /** full name of model */
     ATTRIB(Turret, model, string, string_null)
     /** full name of tur_head model */
     ATTRIB(Turret, head_model, string, string_null)
-    /** TODO: deprecate! */
-    ATTRIB(Turret, cvar_basename, string, string_null)
 
     ATTRIB(Turret, spawnflags, int, 0)
     /** turret hitbox size */
@@ -170,4 +160,29 @@ CLASS(Turret, Object)
 
 ENDCLASS(Turret)
 
+// turret requests
+const int TR_SETUP = 1; // (BOTH) setup turret data
+.bool(Turret) tr_setup;
+const int TR_THINK = 2; // (SERVER) logic to run every frame
+.bool(Turret) tr_think;
+const int TR_DEATH = 3; // (SERVER) called when turret dies
+.bool(Turret) tr_death;
+const int TR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this turret
+.bool(Turret) tr_precache;
+const int TR_ATTACK = 5; // (SERVER) called when turret attacks
+.bool(Turret) tr_attack;
+const int TR_CONFIG = 6; // (ALL)
+.bool(Turret) tr_config;
+
+bool t_new(Turret this, int req)
+{
+    if (req == TR_SETUP) return this.tr_setup ? this.tr_setup(this) : false;
+    if (req == TR_THINK) return this.tr_think ? this.tr_think(this) : false;
+    if (req == TR_DEATH) return this.tr_death ? this.tr_death(this) : false;
+    if (req == TR_PRECACHE) return this.tr_precache ? this.tr_precache(this) : false;
+    if (req == TR_ATTACK) return this.tr_attack ? this.tr_attack(this) : false;
+    if (req == TR_CONFIG) return this.tr_config ? this.tr_config(this) : false;
+    return false;
+}
+
 #endif
index a27860bc4fa16bd34e4aa33dd029c3e44fe7b723..44e7f18e268c8579ded8f52202786f58b08c9f23 100644 (file)
@@ -126,7 +126,7 @@ void ewheel_move_idle()
 
 void spawnfunc_turret_ewheel() { SELFPARAM(); if(!turret_initialize(TUR_EWHEEL.m_id)) remove(self); }
 
-float t_ewheel(float req)
+float t_ewheel(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -284,7 +284,7 @@ void ewheel_draw()
         te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
 }
 
-float t_ewheel(float req)
+float t_ewheel(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
index aacefd16471b4897d6d49f90cc92f34c4c117ad4..bcd46a364a7ff6bb3aebd35dd7bcaf93fad1c0bb 100644 (file)
@@ -33,7 +33,7 @@ void turret_flac_projectile_think_explode()
 
 void spawnfunc_turret_flac() { SELFPARAM(); if(!turret_initialize(TUR_FLAC.m_id)) remove(self); }
 
-float t_flac(float req)
+float t_flac(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -83,7 +83,7 @@ float t_flac(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_flac(float req)
+float t_flac(Turret thistur, float req)
 {
     switch(req)
     {
index 7d2f4f0b67563e9b088be8f6e6d66c225f7ec515..89fdef5d46b8250161ed2d86a293c54e36aca331 100644 (file)
@@ -45,7 +45,7 @@ bool turret_fusionreactor_firecheck()
 
 void spawnfunc_turret_fusionreactor() { SELFPARAM(); if(!turret_initialize(TUR_FUSIONREACTOR.m_id)) remove(self); }
 
-float t_fusionreactor(float req)
+float t_fusionreactor(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -96,7 +96,7 @@ float t_fusionreactor(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_fusionreactor(float req)
+float t_fusionreactor(Turret thistur, float req)
 {
     switch(req)
     {
index 9efae2d968342ba31ae5642313512334359660c5..6b0393057eaeb79f5efbe4e011b87c35efad7f63 100644 (file)
@@ -81,7 +81,7 @@ void turret_hellion_missile_think()
 
 void spawnfunc_turret_hellion() { SELFPARAM(); if(!turret_initialize(TUR_HELLION.m_id)) remove(self); }
 
-float t_hellion(float req)
+float t_hellion(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -140,7 +140,7 @@ float t_hellion(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_hellion(float req)
+float t_hellion(Turret thistur, float req)
 {
     switch(req)
     {
index 8ec6f16bc0489ec1200de88d6cf368e29667e120..63ad489c6de26b4f06e04fed798ff0ffdf10e8bb 100644 (file)
@@ -278,7 +278,7 @@ float turret_hk_addtarget(entity e_target,entity e_sender)
 
 void spawnfunc_turret_hk() { SELFPARAM(); if(!turret_initialize(TUR_HK.m_id)) remove(self); }
 
-float t_hk(float req)
+float t_hk(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -341,7 +341,7 @@ float t_hk(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_hk(float req)
+float t_hk(Turret thistur, float req)
 {
     switch(req)
     {
index 48a200cd7ead77d5c166f62836cd58e2886974e7..07c641ee788e6bb0f7abe9c1978cff689a78e2a5 100644 (file)
@@ -18,7 +18,7 @@ void spawnfunc_turret_machinegun() { SELFPARAM(); if(!turret_initialize(TUR_MACH
 
 void W_MachineGun_MuzzleFlash(void);
 
-float t_machinegun(float req)
+float t_machinegun(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -60,7 +60,7 @@ float t_machinegun(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_machinegun(float req)
+float t_machinegun(Turret thistur, float req)
 {
     switch(req)
     {
index fe3775bd19502f78c32887d2bed0b52ad50cfa58..d2c28abb792244f05954c3130d7a07178700940e 100644 (file)
@@ -16,7 +16,7 @@ REGISTER_TURRET(
 #ifdef SVQC
 void spawnfunc_turret_mlrs() { SELFPARAM(); if(!turret_initialize(TUR_MLRS.m_id)) remove(self); }
 
-float t_mlrs(float req)
+float t_mlrs(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -70,7 +70,7 @@ float t_mlrs(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_mlrs(float req)
+float t_mlrs(Turret thistur, float req)
 {
     switch(req)
     {
index 9e162495ba640b8216bd25c366ad701a21cab128..f0b8e227daa69b91c652e8739a00115bdbb1eceb 100644 (file)
@@ -62,7 +62,7 @@ void beam_think()
 
 void spawnfunc_turret_phaser() { SELFPARAM(); if(!turret_initialize(TUR_PHASER.m_id)) remove(self); }
 
-float t_phaser(float req)
+float t_phaser(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -149,7 +149,7 @@ float t_phaser(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_phaser(float req)
+float t_phaser(Turret thistur, float req)
 {
     switch(req)
     {
index 0cfe13ca690fe06538b3bd6a4cf9bf559faca231..a528af21ea785c00fbc06e455ef1c158960515fb 100644 (file)
@@ -16,7 +16,7 @@ REGISTER_TURRET(
 #ifdef SVQC
 void spawnfunc_turret_plasma() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA.m_id)) remove(self); }
 
-float t_plasma(float req)
+float t_plasma(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -86,7 +86,7 @@ float t_plasma(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_plasma(float req)
+float t_plasma(Turret thistur, float req)
 {
     switch(req)
     {
index 74713eaa9244d6f396db7e41647fc45578d944a4..1f4ea0a6d3a9f4480b7a4104d5b12e095306340f 100644 (file)
@@ -26,7 +26,6 @@ REGISTER_WEAPON(PLASMA_DUAL, NEW(PlasmaDualAttack));
 
 #ifdef SVQC
 
-float t_plasma_dual(float req);
 METHOD(PlasmaDualAttack, wr_think, bool(entity thiswep)) {
        SELFPARAM();
        if (self.BUTTON_ATCK)
@@ -37,7 +36,7 @@ METHOD(PlasmaDualAttack, wr_think, bool(entity thiswep)) {
                self.tur_head = self;
         self.shot_speed = max(1, ((!self.shot_speed) ? 2500 : self.shot_speed));
         self.shot_spread = bound(0.0001, ((!self.shot_spread) ? 0.0125 : self.shot_spread), 500);
-               t_plasma_dual(TR_ATTACK);
+        TUR_ACTION(TUR_PLASMA_DUAL.m_id, TR_ATTACK);
                weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
        }
        return true;
@@ -45,7 +44,7 @@ METHOD(PlasmaDualAttack, wr_think, bool(entity thiswep)) {
 
 void spawnfunc_turret_plasma_dual() { SELFPARAM(); if(!turret_initialize(TUR_PLASMA_DUAL.m_id)) remove(self); }
 
-float t_plasma_dual(float req)
+float t_plasma_dual(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -113,7 +112,7 @@ float t_plasma_dual(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_plasma_dual(float req)
+float t_plasma_dual(Turret thistur, float req)
 {
     switch(req)
     {
index 66c6751578aa6c58179d94b39afaa78fb21e907b..6851d5479a94a0e6af49653fb8851b596b5b025a 100644 (file)
@@ -94,7 +94,7 @@ float turret_tesla_firecheck()
 
 void spawnfunc_turret_tesla() { SELFPARAM(); if(!turret_initialize(TUR_TESLA.m_id)) remove(self); }
 
-float t_tesla(float req)
+float t_tesla(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -197,7 +197,7 @@ float t_tesla(float req)
 
 #endif // SVQC
 #ifdef CSQC
-float t_tesla(float req)
+float t_tesla(Turret thistur, float req)
 {
     switch(req)
     {
index 82fb622384746fe5eb671e1f55af4e9978e826a1..f6855e70efe99b52f56cd07a328c1fa4c33af6dc 100644 (file)
@@ -339,7 +339,7 @@ void walker_move_path()
 
 void spawnfunc_turret_walker() { SELFPARAM(); if(!turret_initialize(TUR_WALKER.m_id)) remove(self); }
 
-float t_walker(float req)
+float t_walker(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {
@@ -669,7 +669,7 @@ void walker_draw()
         te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
 }
 
-float t_walker(float req)
+float t_walker(Turret thistur, float req)
 {SELFPARAM();
     switch(req)
     {