]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move sv_q3acompat_machineshotgunswap weapon_shotgun swap from shotgun.qc to quake3.qc
authorbones_was_here <bones_was_here@yahoo.com.au>
Sat, 11 Jul 2020 06:54:07 +0000 (16:54 +1000)
committerbones_was_here <bones_was_here@yahoo.com.au>
Sat, 11 Jul 2020 06:54:07 +0000 (16:54 +1000)
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/shotgun.qh
qcsrc/server/compat/quake3.qc

index b8cae5fd5da0d66c0216c9806c788b1752cfab8d..9b1c81f31c73ef8bc46056e2b8ec137d419a1448 100644 (file)
@@ -5,15 +5,6 @@
 // enable to debug melee range
 //#define SHOTGUN_MELEEDEBUG
 
-METHOD(Shotgun, m_spawnfunc_hookreplace, Weapon(Shotgun this, entity e))
-{
-       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
-       {
-               return WEP_MACHINEGUN;
-       }
-       return this;
-}
-
 void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float isprimary, float ammocount, float damage, float bullets, float spread, float solidpenetration, float force, entity bullet_trail_effect)
 {
        W_DecreaseAmmo(thiswep, actor, ammocount, weaponentity);
@@ -27,7 +18,7 @@ void W_Shotgun_Attack(Weapon thiswep, entity actor, .entity weaponentity, float
 
        for(int sc = 0;sc < bullets;sc = sc + 1)
                fireBullet_antilag(actor, weaponentity, w_shotorg, w_shotdir, spread, solidpenetration, damage, force, thiswep.m_id, bullet_trail_effect, false);
-       
+
        if(lag && bullets > 0)
                antilag_restore_all(actor);
 
index dc6dae157d7f81d345076370d116a92d332d1eb4..25bc9123d7bd89bd9901c0627fcd4a1f0a1dd2b2 100644 (file)
@@ -54,4 +54,3 @@ CLASS(Shotgun, Weapon)
 ENDCLASS(Shotgun)
 REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun));
 
-SPAWNFUNC_WEAPON(weapon_shotgun, WEP_SHOTGUN)
index 05a956f9a755bb3ef1a1611f9057a077a408f51a..280b62897fa554263a612e18716c5cf1031d4518 100644 (file)
@@ -19,6 +19,7 @@
 
 // SG -> MG || SG
 SPAWNFUNC_ITEM_COND(ammo_shells, autocvar_sv_q3acompat_machineshotgunswap, ITEM_Bullets, ITEM_Shells)
+SPAWNFUNC_WEAPON_COND(weapon_shotgun, autocvar_sv_q3acompat_machineshotgunswap, WEP_MACHINEGUN, WEP_SHOTGUN)
 
 // MG -> SG || MG
 SPAWNFUNC_ITEM_COND(ammo_bullets, autocvar_sv_q3acompat_machineshotgunswap, ITEM_Shells, ITEM_Bullets)