}
}
-void W_Crylink_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_crylink_reload_ammo && self.ammo_cells) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_cells -= 1;
- }
- self.crylink_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_crylink_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_Crylink_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_crylink_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_cells, min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_crylink_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_crylink_reload_time, W_Crylink_ReloadedAndReady);
+ self.reload_ammo_player = ammo_cells;
+ self.reload_ammo_min = min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_crylink_reload_ammo;
+ self.reload_time = autocvar_g_balance_crylink_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_Crylink_CheckLinks(entity e)
}
}
-void W_Electro_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_electro_reload_ammo && self.ammo_cells) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_cells -= 1;
- }
- self.electro_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_electro_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_Electro_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_electro_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_cells, min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_electro_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_electro_reload_time, W_Electro_ReloadedAndReady);
+ self.reload_ammo_player = ammo_cells;
+ self.reload_ammo_min = min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_electro_reload_ammo;
+ self.reload_time = autocvar_g_balance_electro_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_Plasma_Explode_Combo (void);
}
}
-void W_Fireball_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_fireball_reload_ammo && self.ammo_fuel) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_fuel -= 1;
-
- // fuel can be a non-whole number, which brakes stuff here when between 0 and 1
- if(self.ammo_fuel < 1)
- self.ammo_fuel = 0;
- }
- self.fireball_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_fireball_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_Fireball_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_fireball_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_fuel, min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_fireball_reload_time + 1;
- ATTACK_FINISHED(self) = t;
+ // fuel can be a non-whole number, which brakes stuff here when between 0 and 1
+ if(self.ammo_fuel < 1)
+ self.ammo_fuel = 0;
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_fireball_reload_time, W_Fireball_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = min(autocvar_g_balance_fireball_primary_ammo, autocvar_g_balance_fireball_secondary_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_fireball_reload_ammo;
+ self.reload_time = autocvar_g_balance_fireball_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_Fireball_Explode (void)
}
}
-void W_GrenadeLauncher_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_grenadelauncher_reload_ammo && self.ammo_rockets) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_rockets -= 1;
- }
- self.grenadelauncher_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_grenadelauncher_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_GrenadeLauncher_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_grenadelauncher_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_rockets, min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_grenadelauncher_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_grenadelauncher_reload_time, W_GrenadeLauncher_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_grenadelauncher_reload_ammo;
+ self.reload_time = autocvar_g_balance_grenadelauncher_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_Grenade_Explode (void)
}
}
-void W_HLAC_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_hlac_reload_ammo && self.ammo_cells) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_cells -= 1;
- }
- self.hlac_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_hlac_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_HLAC_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_hlac_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_cells, min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_hlac_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_hlac_reload_time, W_HLAC_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_hlac_reload_ammo;
+ self.reload_time = autocvar_g_balance_hlac_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_HLAC_Touch (void)
}
}
-void W_MineLayer_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_minelayer_reload_ammo && self.ammo_rockets) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_rockets -= 1;
- }
- self.minelayer_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_minelayer_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_MineLayer_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_minelayer_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_rockets, autocvar_g_balance_minelayer_ammo))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_minelayer_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_minelayer_reload_time, W_MineLayer_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = autocvar_g_balance_minelayer_ammo;
+ self.reload_ammo_amount = autocvar_g_balance_minelayer_reload_ammo;
+ self.reload_time = autocvar_g_balance_minelayer_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void spawnfunc_weapon_minelayer (void)
}
}
-void W_Minstanex_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_minstanex_reload_ammo && self.ammo_cells) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_cells -= 1;
- }
- self.minstanex_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_minstanex_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_Minstanex_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_minstanex_reload_ammo)
- return;
-
+ self.reload_ammo_player = ammo_fuel;
if(autocvar_g_balance_minstanex_laser_ammo)
- {
- if(!W_ReloadCheck(self.ammo_cells, min(autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo)))
- return;
- }
- else if(!W_ReloadCheck(self.ammo_cells, autocvar_g_balance_minstanex_ammo))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_minstanex_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_minstanex_reload_time, W_Minstanex_ReloadedAndReady);
+ self.reload_ammo_min = min(autocvar_g_balance_minstanex_ammo, autocvar_g_balance_minstanex_laser_ammo);
+ else
+ self.reload_ammo_min = autocvar_g_balance_minstanex_ammo;
+ self.reload_ammo_amount = autocvar_g_balance_minstanex_reload_ammo;
+ self.reload_time = autocvar_g_balance_minstanex_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_MinstaNex_Attack (void)
}
}
-void W_Nex_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_nex_reload_ammo && self.ammo_cells) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_cells -= 1;
- }
- self.nex_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_nex_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_Nex_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_nex_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_cells, min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_nex_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_nex_reload_time, W_Nex_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_nex_reload_ammo;
+ self.reload_time = autocvar_g_balance_nex_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void SendCSQCNexBeamParticle(float charge) {
}
}
-void W_RocketLauncher_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_rocketlauncher_reload_ammo && self.ammo_rockets) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_rockets -= 1;
- }
- self.rocketlauncher_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_rocketlauncher_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_RocketLauncher_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_rocketlauncher_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_rockets, autocvar_g_balance_rocketlauncher_ammo))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_rocketlauncher_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_rocketlauncher_reload_time, W_RocketLauncher_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = autocvar_g_balance_rocketlauncher_ammo;
+ self.reload_ammo_amount = autocvar_g_balance_rocketlauncher_reload_ammo;
+ self.reload_time = autocvar_g_balance_rocketlauncher_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_Rocket_Unregister()
}
}
-void W_Seeker_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_seeker_reload_ammo && self.ammo_rockets) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_rockets -= 1;
- }
- self.seeker_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_seeker_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_Seeker_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_seeker_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_rockets, min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_seeker_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_seeker_reload_time, W_Seeker_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_seeker_reload_ammo;
+ self.reload_time = autocvar_g_balance_seeker_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void Seeker_Missile_Explode ()
}
}
-void W_Shotgun_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_shotgun_reload_ammo && self.ammo_shells) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_shells -= 1;
- }
- self.shotgun_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_shotgun_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_Shotgun_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_shotgun_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_shells, autocvar_g_balance_shotgun_primary_ammo))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_shotgun_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_shotgun_reload_time, W_Shotgun_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = autocvar_g_balance_shotgun_primary_ammo;
+ self.reload_ammo_amount = autocvar_g_balance_shotgun_reload_ammo;
+ self.reload_time = autocvar_g_balance_shotgun_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_Shotgun_Attack (void)
}
}
-void W_SniperRifle_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_sniperrifle_reload_ammo && self.ammo_nails) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_nails -= 1;
- }
- self.sniperrifle_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_sniperrifle_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_SniperRifle_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_sniperrifle_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_nails, min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_sniperrifle_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reload_time, W_SniperRifle_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_sniperrifle_reload_ammo;
+ self.reload_time = autocvar_g_balance_sniperrifle_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
}
}
-void W_UZI_ReloadedAndReady()
-{
- float t;
-
- // now do the ammo transfer
- self.clip_load = self.old_clip_load; // restore the ammo counter, in case we still had ammo in the weapon before reloading
- while(self.clip_load < autocvar_g_balance_uzi_reload_ammo && self.ammo_nails) // make sure we don't add more ammo than we have
- {
- self.clip_load += 1;
- self.ammo_nails -= 1;
- }
- self.uzi_load = self.clip_load;
-
- t = ATTACK_FINISHED(self) - autocvar_g_balance_uzi_reload_time - 1;
- ATTACK_FINISHED(self) = t;
- w_ready();
-}
-
void W_UZI_Reload()
{
- // return if reloading is disabled for this weapon
- if(!autocvar_g_balance_uzi_reload_ammo)
- return;
-
- if(!W_ReloadCheck(self.ammo_nails, min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo)))
- return;
-
- float t;
-
- sound (self, CHAN_WEAPON2, "weapons/reload.wav", VOL_BASE, ATTN_NORM);
-
- t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_uzi_reload_time + 1;
- ATTACK_FINISHED(self) = t;
-
- weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_uzi_reload_time, W_UZI_ReloadedAndReady);
+ self.reload_ammo_player = ammo_fuel;
+ self.reload_ammo_min = min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo);
+ self.reload_ammo_amount = autocvar_g_balance_uzi_reload_ammo;
+ self.reload_time = autocvar_g_balance_uzi_reload_time;
+ self.reload_sound = "weapons/reload.wav";
- self.old_clip_load = self.clip_load;
- self.clip_load = -1;
+ W_Reload();
}
// leilei's fancy muzzleflash stuff