]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/shotgun.qc
Create a model list
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / shotgun.qc
index 9024bbfa1f70e36b57db17674bf6498f7c5e6d0a..814d5730368d3ec40c1bb3c405efee9a492d001e 100644 (file)
@@ -55,7 +55,7 @@ SHOTGUN_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
 void spawnfunc_weapon_shotgun(void) { weapon_defaultspawnfunc(WEP_SHOTGUN.m_id); }
 
 void W_Shotgun_Attack(float isprimary)
-{
+{SELFPARAM();
        float   sc;
        entity flash;
 
@@ -74,7 +74,7 @@ void W_Shotgun_Attack(float isprimary)
 
        // muzzle flash for 1st person view
        flash = spawn();
-       setmodel(flash, "models/uziflash.md3"); // precision set below
+       setmodel(flash, MDL_SHOTGUN_MUZZLEFLASH); // precision set below
        flash.think = SUB_Remove;
        flash.nextthink = time + 0.06;
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
@@ -84,7 +84,7 @@ void W_Shotgun_Attack(float isprimary)
 .float swing_prev;
 .entity swing_alreadyhit;
 void W_Shotgun_Melee_Think(void)
-{
+{SELFPARAM();
        // declarations
        float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
        entity target_victim;
@@ -180,7 +180,7 @@ void W_Shotgun_Melee_Think(void)
 }
 
 void W_Shotgun_Attack2(void)
-{
+{SELFPARAM();
        sound(self, CH_WEAPON_A, W_Sound("shotgun_melee"), VOL_BASE, ATTEN_NORM);
        weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(shotgun, animtime), w_ready);
 
@@ -194,7 +194,7 @@ void W_Shotgun_Attack2(void)
 
 // alternate secondary weapon frames
 void W_Shotgun_Attack3_Frame2()
-{
+{SELFPARAM();
        if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
        if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
        {
@@ -208,7 +208,7 @@ void W_Shotgun_Attack3_Frame2()
        weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_SEC(shotgun, alt_animtime), w_ready);
 }
 void W_Shotgun_Attack3_Frame1()
-{
+{SELFPARAM();
        if (!WEP_ACTION(self.weapon, WR_CHECKAMMO2))
        if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
        {
@@ -224,7 +224,7 @@ void W_Shotgun_Attack3_Frame1()
 .float shotgun_primarytime;
 
 float W_Shotgun(float req)
-{
+{SELFPARAM();
        float ammo_amount;
        switch(req)
        {
@@ -286,10 +286,6 @@ float W_Shotgun(float req)
                }
                case WR_INIT:
                {
-                       precache_model("models/uziflash.md3");
-                       precache_model(W_Model("g_shotgun.md3"));
-                       precache_model(W_Model("v_shotgun.md3"));
-                       precache_model(W_Model("h_shotgun.iqm"));
                        precache_sound("misc/itempickup.wav");
                        precache_sound(W_Sound("shotgun_fire"));
                        precache_sound(W_Sound("shotgun_melee"));
@@ -352,7 +348,7 @@ float W_Shotgun(float req)
 #ifdef CSQC
 .float prevric;
 float W_Shotgun(float req)
-{
+{SELFPARAM();
        switch(req)
        {
                case WR_IMPACTEFFECT: