sprint(self, strcat("You don't have enough ammo to reload the ^2", W_Name(self.weapon), "\n"));
self.reload_complain = time + 1;
}
-
// switch away if the amount of ammo is not enough to keep using this weapon
if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2))
{
return TRUE;
}
-void W_ReloadEnd()
+void W_ReloadedAndReady()
{
// finish the reloading process, and do the ammo transfer
w_ready();
}
-void W_ReloadStart()
+void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, string sent_sound)
{
- // begin the reloading process
+ // set global values to work with
+ self.reload_ammo_min = sent_ammo_min;
+ self.reload_ammo_amount = sent_ammo_amount;
+ self.reload_time = sent_time;
+ self.reload_sound = sent_sound;
+
+ if(!W_ReloadCheck())
+ return;
+
+ // now begin the reloading process
sound (self, CHAN_WEAPON2, self.reload_sound, VOL_BASE, ATTN_NORM);
//ATTACK_FINISHED(self) = max(time, ATTACK_FINISHED(self)) + self.reload_time + 1;
- weapon_thinkf(WFRAME_RELOAD, self.reload_time, W_ReloadEnd);
+ weapon_thinkf(WFRAME_RELOAD, self.reload_time, W_ReloadedAndReady);
self.old_clip_load = self.clip_load;
self.clip_load = -1;
-}
-
-void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, string sent_sound)
-{
- // set global values to work with
- self.reload_ammo_min = sent_ammo_min;
- self.reload_ammo_amount = sent_ammo_amount;
- self.reload_time = sent_time;
- self.reload_sound = sent_sound;
-
- if(!W_ReloadCheck())
- return;
-
- // now begin the actual reloading
- W_ReloadStart();
}
\ No newline at end of file