]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix the remaining issues. At this point, the reload code is working as indented ...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 16:05:35 +0000 (18:05 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Fri, 21 Jan 2011 16:05:35 +0000 (18:05 +0200)
balanceXonotic.cfg
qcsrc/server/w_shotgun.qc
qcsrc/server/w_sniperrifle.qc

index 1f204aba4fc62ef2bb1e118ad8bb3a6c7d4265df..d722dd720f85d17878ed5acc68b68ecec191d01a 100644 (file)
@@ -642,7 +642,7 @@ set g_balance_sniperrifle_secondary_ammo 10
 set g_balance_sniperrifle_secondary_bulletconstant 110 // 15.5qu
 set g_balance_sniperrifle_secondary_burstcost 0
 set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
-set g_balance_sniperrifle_reload_ammo 8
+set g_balance_sniperrifle_reload_ammo 40
 set g_balance_sniperrifle_reload_time 2
 // }}}
 // {{{ tuba
index 6202b518b904dfa90dc222767bf324516641c2c4..328be10c03a336ed9fd3b8738450a3a9f79f4764 100644 (file)
@@ -81,13 +81,6 @@ void W_Shotgun_Attack (void)
        for (sc = 0;sc < bullets;sc = sc + 1)
                fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
        endFireBallisticBullet();
-       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-       {
-               if(!autocvar_g_balance_shotgun_reload_ammo)
-                       self.ammo_shells -= ammoamount;
-               else
-                       self.shotgun_load -= ammoamount;
-       }
 
        pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shotgun_primary_ammo);
 
@@ -104,7 +97,16 @@ void W_Shotgun_Attack (void)
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
        W_AttachToShotorg(flash, '5 0 0');
 
-       self.ammo_counter = self.ammo_counter - 1;
+       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+       {
+               if(!autocvar_g_balance_shotgun_reload_ammo)
+                       self.ammo_shells -= ammoamount;
+               else
+               {
+                       self.ammo_counter -= ammoamount;
+                       self.shotgun_load = self.ammo_counter;
+               }
+       }
 }
 
 void shotgun_meleethink (void)
index c17f683449b902aa3184b2f8cabe0c95b08b110e..b6465044bc67f59cef291d9aaa4e1ed82f7c344f 100644 (file)
@@ -60,10 +60,6 @@ void W_SniperRifle_Reload()
 
 void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
 {
-       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-       if(!autocvar_g_balance_sniperrifle_reload_ammo)
-               self.ammo_nails -= pAmmo;
-
        if(deathtype & HITTYPE_SECONDARY)
                W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, autocvar_g_balance_sniperrifle_secondary_damage + autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage);
        else
@@ -89,9 +85,12 @@ void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAdded
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
                if(!autocvar_g_balance_sniperrifle_reload_ammo)
-                       self.ammo_nails -= 1;
+                       self.ammo_nails -= pAmmo;
                else
-                       self.sniperrifle_load -= 1;
+               {
+                       self.ammo_counter -= pAmmo;
+                       self.sniperrifle_load = self.ammo_counter;
+               }
        }
 }