#else
#ifdef SVQC
-.float shotgun_load;
-
void W_Shotgun_SetAmmoCounter()
{
// set clip_load to the weapon we have switched to, if the gun uses reloading
if(!autocvar_g_balance_shotgun_reload_ammo)
return;
- if(!W_ReloadCheck(self.ammo_shells))
+ if(!W_ReloadCheck(self.ammo_shells, autocvar_g_balance_shotgun_primary_ammo))
return;
float t;
float bulletconstant;
local entity flash;
- if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load <= 0)
- return; // reloading, so we are done
-
ammoamount = autocvar_g_balance_shotgun_primary_ammo;
bullets = autocvar_g_balance_shotgun_primary_bullets;
d = autocvar_g_balance_shotgun_primary_damage;
bulletspeed = autocvar_g_balance_shotgun_primary_speed;
bulletconstant = autocvar_g_balance_shotgun_primary_bulletconstant;
+ // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ {
+ if(autocvar_g_balance_shotgun_reload_ammo)
+ {
+ self.clip_load -= ammoamount;
+ self.shotgun_load = self.clip_load;
+ }
+ else
+ self.ammo_shells -= ammoamount;
+ }
+
W_SetupShot (self, autocvar_g_antilag_bullets && bulletspeed >= autocvar_g_antilag_bullets, 5, "weapons/shotgun_fire.wav", CHAN_WEAPON, d * bullets);
for (sc = 0;sc < bullets;sc = sc + 1)
fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, 0, f, WEP_SHOTGUN, 0, 1, bulletconstant);
flash.nextthink = time + 0.06;
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
W_AttachToShotorg(flash, '5 0 0');
-
- // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- {
- if(autocvar_g_balance_shotgun_reload_ammo)
- {
- self.clip_load -= ammoamount;
- self.shotgun_load = self.clip_load;
- }
- else
- self.ammo_shells -= ammoamount;
- }
}
void shotgun_meleethink (void)
self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, FALSE);
else if (req == WR_THINK)
{
- if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load <= 0) // forced reload
+ if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load < autocvar_g_balance_shotgun_primary_ammo) // forced reload
W_Shotgun_Reload();
else
{