local entity missile;
float spread;
- // 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_hlac_reload_ammo)
- {
- self.clip_load -= autocvar_g_balance_hlac_primary_ammo;
- self.weapon_load[WEP_HLAC] = self.clip_load;
- }
- else
- self.ammo_cells -= autocvar_g_balance_hlac_primary_ammo;
- }
+ W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_reload_ammo);
spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.misc_bulletcounter);
spread = min(spread,autocvar_g_balance_hlac_primary_spread_max);
{
float i;
- // 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_hlac_reload_ammo)
- {
- self.clip_load -= autocvar_g_balance_hlac_secondary_ammo;
- self.weapon_load[WEP_HLAC] = self.clip_load;
- }
- else
- self.ammo_cells -= autocvar_g_balance_hlac_secondary_ammo;
- }
+ W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hlac_secondary_ammo, autocvar_g_balance_hlac_reload_ammo);
for(i=autocvar_g_balance_hlac_secondary_shots;i>0;--i)
W_HLAC_Attack2f();
if (self.BUTTON_ATCK)
{
if (!weapon_action(self.weapon, WR_CHECKAMMO1))
+ if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
W_SwitchWeapon_Force(self, w_getbestweapon(self));
w_ready();
precache_model ("models/weapons/v_hlac.md3");
precache_model ("models/weapons/h_hlac.iqm");
precache_sound ("weapons/lasergun_fire.wav");
- precache_sound ("weapons/reload.wav");
+ //precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound somewhere else
}
else if (req == WR_SETUP)
{
weapon_setup(WEP_HLAC);
+ self.current_ammo = ammo_cells;
}
else if (req == WR_CHECKAMMO1)
{
}
else if (req == WR_RELOAD)
{
- W_Reload(ammo_cells, min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
+ W_Reload(min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
}
return TRUE;
};