]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/blaster.qc
Deprecate weapon_func
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / blaster.qc
index 6234f4a3e1154b1233afa9ee52ad5fd1b0d7f06d..1038cfaf2fe5db3b9b713db7195cbb284eb58139 100644 (file)
@@ -52,7 +52,7 @@ void spawnfunc_weapon_blaster(void) { weapon_defaultspawnfunc(WEP_BLASTER.m_id);
 void spawnfunc_weapon_laser(void) { spawnfunc_weapon_blaster(); }
 
 void W_Blaster_Touch(void)
-{
+{SELFPARAM();
        PROJECTILE_TOUCH;
 
        self.event_damage = func_null;
@@ -74,7 +74,7 @@ void W_Blaster_Touch(void)
 }
 
 void W_Blaster_Think(void)
-{
+{SELFPARAM();
        self.movetype = MOVETYPE_FLY;
        self.think = SUB_Remove;
        self.nextthink = time + self.blaster_lifetime;
@@ -92,7 +92,7 @@ void W_Blaster_Attack(
        float atk_spread,
        float atk_delay,
        float atk_lifetime)
-{
+{SELFPARAM();
        vector s_forward = v_forward * cos(atk_shotangle * DEG2RAD) + v_up * sin(atk_shotangle * DEG2RAD);
 
        W_SetupShot_Dir(self, s_forward, false, 3, W_Sound("lasergun_fire"), CH_WEAPON_B, atk_damage);
@@ -141,15 +141,11 @@ void W_Blaster_Attack(
 
        if(time >= missile.nextthink)
        {
-               entity oldself;
-               oldself = self;
-               self = missile;
-               self.think();
-               self = oldself;
+               WITH(entity, self, missile, missile.think());
        }
 }
-bool W_Blaster(int request)
-{
+bool W_Blaster(entity thiswep, int request)
+{SELFPARAM();
        switch(request)
        {
                case WR_AIM:
@@ -227,9 +223,6 @@ bool W_Blaster(int request)
 
                case WR_INIT:
                {
-                       precache_model(W_Model("g_laser.md3"));
-                       precache_model(W_Model("v_laser.md3"));
-                       precache_model(W_Model("h_laser.iqm"));
                        precache_sound(W_Sound("lasergun_fire"));
                        BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
                        return true;
@@ -267,8 +260,8 @@ bool W_Blaster(int request)
 }
 #endif
 #ifdef CSQC
-bool W_Blaster(int request)
-{
+bool W_Blaster(entity thiswep, int request)
+{SELFPARAM();
        switch(request)
        {
                case WR_IMPACTEFFECT: