]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/vaporizer.qc
Remove various SELFPARAM
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / vaporizer.qc
index cd05a8682b92fb30a6870c024c8afa4622febe9a..c4672e727c53a05a19c945308291801aecb8518f 100644 (file)
@@ -137,7 +137,7 @@ void VaporizerBeam_Draw(entity this)
 NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
 {
        Net_Accept(vortex_beam);
-       this.think = SUB_Remove_self;
+       setthink(this, SUB_Remove);
        this.nextthink = time + bound(0, autocvar_cl_vaporizerbeam_lifetime, 10);
        this.draw = VaporizerBeam_Draw;
        this.drawmask = MASK_NORMAL;
@@ -167,8 +167,8 @@ NET_HANDLE(TE_CSQC_VAPORBEAMPARTICLE, bool isNew)
 spawnfunc(weapon_vaporizer) { weapon_defaultspawnfunc(this, WEP_VAPORIZER); }
 spawnfunc(weapon_minstanex) { spawnfunc_weapon_vaporizer(this); }
 
-void W_RocketMinsta_Explosion(vector loc)
-{SELFPARAM();
+void W_RocketMinsta_Explosion(entity actor, vector loc)
+{entity this = actor;
        if(accuracy_canbegooddamage(self))
                accuracy_add(self, WEP_DEVASTATOR.m_id, autocvar_g_rm_damage, 0);
        entity dmgent = spawn();
@@ -178,8 +178,8 @@ void W_RocketMinsta_Explosion(vector loc)
        remove(dmgent);
 }
 
-void W_Vaporizer_Attack(Weapon thiswep)
-{SELFPARAM();
+void W_Vaporizer_Attack(Weapon thiswep, entity actor)
+{entity this = actor;
        bool flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
        float vaporizer_damage = ((WEP_CVAR_PRI(vaporizer, damage) > 0) ? WEP_CVAR_PRI(vaporizer, damage) : 10000);
 
@@ -207,13 +207,13 @@ void W_Vaporizer_Attack(Weapon thiswep)
 
        if(autocvar_g_rm)
        if(!(trace_dphitq3surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT)))
-               W_RocketMinsta_Explosion(trace_endpos);
+               W_RocketMinsta_Explosion(self, trace_endpos);
 
        W_DecreaseAmmo(thiswep, self, ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)));
 }
 
-void W_RocketMinsta_Laser_Explode ()
-{SELFPARAM();
+void W_RocketMinsta_Laser_Explode (entity this)
+{
        if(other.takedamage == DAMAGE_AIM)
                if(IS_PLAYER(other))
                        if(DIFF_TEAM(self.realowner, other))
@@ -229,19 +229,19 @@ void W_RocketMinsta_Laser_Explode ()
 
 void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger)
 {
-       WITHSELF(this, W_RocketMinsta_Laser_Explode());
+       WITHSELF(this, W_RocketMinsta_Laser_Explode(this));
 }
 
-void W_RocketMinsta_Laser_Touch ()
-{SELFPARAM();
-       PROJECTILE_TOUCH;
+void W_RocketMinsta_Laser_Touch (entity this)
+{
+       PROJECTILE_TOUCH(this);
        //W_RocketMinsta_Laser_Explode ();
        RadiusDamage (self, self.realowner, self.rm_damage, self.rm_edmg, autocvar_g_rm_laser_radius, world, world, self.rm_force, self.projectiledeathtype, other);
        remove(self);
 }
 
-void W_RocketMinsta_Attack2()
-{SELFPARAM();
+void W_RocketMinsta_Attack2(entity actor)
+{entity this = actor;
        makevectors(self.v_angle);
 
        entity proj;
@@ -264,7 +264,7 @@ void W_RocketMinsta_Attack2()
         proj.bot_dodge = true;
         proj.bot_dodgerating = autocvar_g_rm_laser_damage;
         proj.use = W_RocketMinsta_Laser_Explode_use;
-        proj.think = adaptor_think2use_hittype_splash;
+        setthink(proj, adaptor_think2use_hittype_splash);
         proj.nextthink = time + autocvar_g_rm_laser_lifetime;
         PROJECTILE_MAKETRIGGER(proj);
         proj.projectiledeathtype = WEP_ELECTRO.m_id;
@@ -282,7 +282,7 @@ void W_RocketMinsta_Attack2()
                proj.velocity_z = proj.velocity_z + cvar("g_rm_laser_zspread") * (random() - 0.5);
                proj.velocity = W_CalculateProjectileVelocity(proj.realowner.velocity, proj.velocity, true);
         proj.angles = vectoangles(proj.velocity);
-        proj.touch = W_RocketMinsta_Laser_Touch;
+        settouch(proj, W_RocketMinsta_Laser_Touch);
         setsize(proj, '0 0 -3', '0 0 -3');
         proj.flags = FL_PROJECTILE;
         proj.missile_flags = MIF_SPLASH;
@@ -294,8 +294,8 @@ void W_RocketMinsta_Attack2()
     }
 }
 
-void W_RocketMinsta_Attack3 ()
-{SELFPARAM();
+void W_RocketMinsta_Attack3 (entity actor)
+{entity this = actor;
        makevectors(self.v_angle);
 
        entity proj;
@@ -316,7 +316,7 @@ void W_RocketMinsta_Attack3 ()
         proj.bot_dodge = true;
         proj.bot_dodgerating = autocvar_g_rm_laser_damage;
         proj.use = W_RocketMinsta_Laser_Explode_use;
-        proj.think = adaptor_think2use_hittype_splash;
+        setthink(proj, adaptor_think2use_hittype_splash);
         proj.nextthink = time + autocvar_g_rm_laser_lifetime;
         PROJECTILE_MAKETRIGGER(proj);
         proj.projectiledeathtype = WEP_ELECTRO.m_id;
@@ -332,7 +332,7 @@ void W_RocketMinsta_Attack3 ()
                proj.velocity = w_shotdir * autocvar_g_rm_laser_speed;
                proj.velocity = W_CalculateProjectileVelocity(proj.realowner.velocity, proj.velocity, true);
         proj.angles = vectoangles(proj.velocity);
-        proj.touch = W_RocketMinsta_Laser_Touch;
+        settouch(proj, W_RocketMinsta_Laser_Touch);
         setsize(proj, '0 0 -3', '0 0 -3');
         proj.flags = FL_PROJECTILE;
         proj.missile_flags = MIF_SPLASH;
@@ -344,9 +344,9 @@ void W_RocketMinsta_Attack3 ()
     }
 }
 
-METHOD(Vaporizer, wr_aim, void(entity thiswep))
+METHOD(Vaporizer, wr_aim, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     if(self.(thiswep.ammo_field) > 0)
         PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 1, false);
     else
@@ -365,7 +365,7 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent
     {
         if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(vaporizer, refire)))
         {
-            W_Vaporizer_Attack(thiswep);
+            W_Vaporizer_Attack(thiswep, actor);
             weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(vaporizer, animtime), w_ready);
         }
     }
@@ -381,13 +381,13 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent
                 actor.jump_interval = time + autocvar_g_rm_laser_refire;
                 actor.jump_interval2 = time + autocvar_g_rm_laser_rapid_delay;
                 damage_goodhits = 0;
-                W_RocketMinsta_Attack2();
+                W_RocketMinsta_Attack2(actor);
             }
             else if(rapid && actor.jump_interval2 <= time && actor.held_down)
             {
                 actor.jump_interval2 = time + autocvar_g_rm_laser_rapid_refire;
                 damage_goodhits = 0;
-                W_RocketMinsta_Attack3();
+                W_RocketMinsta_Attack3(actor);
                 //weapon_thinkf(actor, WFRAME_FIRE2, autocvar_g_rm_laser_rapid_animtime, w_ready);
             }
         }
@@ -426,9 +426,9 @@ METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponent
     else
         actor.held_down = false;
 }
-METHOD(Vaporizer, wr_setup, void(entity thiswep))
+METHOD(Vaporizer, wr_setup, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     self.ammo_field = (thiswep.ammo_field);
     self.vaporizer_lasthit = 0;
 }
@@ -447,14 +447,13 @@ METHOD(Vaporizer, wr_checkammo2, bool(entity thiswep, entity actor))
     ammo_amount += actor.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo);
     return ammo_amount;
 }
-METHOD(Vaporizer, wr_resetplayer, void(entity thiswep))
+METHOD(Vaporizer, wr_resetplayer, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     self.vaporizer_lasthit = 0;
 }
 METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
 {
-    SELFPARAM();
     float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo));
     float used_ammo;
     if(WEP_CVAR_SEC(vaporizer, ammo))
@@ -462,7 +461,7 @@ METHOD(Vaporizer, wr_reload, void(entity thiswep, entity actor, .entity weaponen
     else
         used_ammo = vaporizer_ammo;
 
-    W_Reload(self, used_ammo, SND_RELOAD);
+    W_Reload(actor, used_ammo, SND_RELOAD);
 }
 METHOD(Vaporizer, wr_suicidemessage, Notification(entity thiswep))
 {
@@ -476,9 +475,9 @@ METHOD(Vaporizer, wr_killmessage, Notification(entity thiswep))
 #endif
 #ifdef CSQC
 
-METHOD(Vaporizer, wr_impacteffect, void(entity thiswep))
+METHOD(Vaporizer, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    SELFPARAM();
+    entity this = actor;
     vector org2 = w_org + w_backoff * 6;
     if(w_deathtype & HITTYPE_SECONDARY)
     {