From 2ed9c0c7f3cf416617ebea90956fb28e0f2df869 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Fri, 21 Jan 2011 18:05:35 +0200 Subject: [PATCH] Fix the remaining issues. At this point, the reload code is working as indented (still far from ready though) --- balanceXonotic.cfg | 2 +- qcsrc/server/w_shotgun.qc | 18 ++++++++++-------- qcsrc/server/w_sniperrifle.qc | 11 +++++------ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index 1f204aba4..d722dd720 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -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 diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index 6202b518b..328be10c0 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -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) diff --git a/qcsrc/server/w_sniperrifle.qc b/qcsrc/server/w_sniperrifle.qc index c17f68344..b6465044b 100644 --- a/qcsrc/server/w_sniperrifle.qc +++ b/qcsrc/server/w_sniperrifle.qc @@ -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; + } } } -- 2.39.2