]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/rifle.qc
Deprecate weapon_func
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / rifle.qc
index ef3babd8723c24128b30f9a6ff813fb676c0c1b9..be77b866c945db4a4d52993b4d8317dac173d4bf 100644 (file)
@@ -52,7 +52,7 @@ void spawnfunc_weapon_campingrifle(void) { spawnfunc_weapon_rifle(); }
 void spawnfunc_weapon_sniperrifle(void) { spawnfunc_weapon_rifle(); }
 
 void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, int deathtype, float pTracer, float pShots, string pSound)
-{
+{SELFPARAM();
        float i;
 
        W_DecreaseAmmo(pAmmo);
@@ -89,7 +89,7 @@ void W_Rifle_Attack2(void)
 .float rifle_bullethail_animtime;
 .float rifle_bullethail_refire;
 void W_Rifle_BulletHail_Continue(void)
-{
+{SELFPARAM();
        float r, sw, af;
 
        sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing
@@ -114,7 +114,7 @@ void W_Rifle_BulletHail_Continue(void)
 }
 
 void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animtime, float refire)
-{
+{SELFPARAM();
        // if we get here, we have at least one bullet to fire
        AttackFunc();
        if(mode)
@@ -134,8 +134,8 @@ void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animt
 }
 
 .float bot_secondary_riflemooth;
-bool W_Rifle(int req)
-{
+bool W_Rifle(entity thiswep, int req)
+{SELFPARAM();
        float ammo_amount;
 
        switch(req)
@@ -168,7 +168,7 @@ bool W_Rifle(int req)
                case WR_THINK:
                {
                        if(autocvar_g_balance_rifle_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo))) // forced reload
-                               WEP_ACTION(self.weapon, WR_RELOAD);
+                               _WEP_ACTION(self.weapon, WR_RELOAD);
                        else
                        {
                                self.rifle_accumulator = bound(time - WEP_CVAR(rifle, bursttime), self.rifle_accumulator, time);
@@ -185,7 +185,7 @@ bool W_Rifle(int req)
                                        if(WEP_CVAR(rifle, secondary))
                                        {
                                                if(WEP_CVAR_SEC(rifle, reload))
-                                                       WEP_ACTION(self.weapon, WR_RELOAD);
+                                                       _WEP_ACTION(self.weapon, WR_RELOAD);
                                                else
                                                {
                                                        if(weapon_prepareattack_check(1, WEP_CVAR_SEC(rifle, refire)))
@@ -204,9 +204,6 @@ bool W_Rifle(int req)
                }
                case WR_INIT:
                {
-                       precache_model(W_Model("g_sniperrifle.md3"));
-                       precache_model(W_Model("v_sniperrifle.md3"));
-                       precache_model(W_Model("h_sniperrifle.iqm"));
                        precache_sound(W_Sound("campingrifle_fire"));
                        precache_sound(W_Sound("campingrifle_fire2"));
                        RIFLE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
@@ -265,8 +262,8 @@ bool W_Rifle(int req)
 }
 #endif
 #ifdef CSQC
-bool W_Rifle(int req)
-{
+bool W_Rifle(entity thiswep, int req)
+{SELFPARAM();
        switch(req)
        {
                case WR_IMPACTEFFECT: