--- a/hedgewars/uTeams.pas Fri Nov 17 13:36:58 2006 +0000
+++ b/hedgewars/uTeams.pas Sat Nov 18 14:47:50 2006 +0000
@@ -349,11 +349,16 @@
end;
procedure SetWeapon(weap: TAmmoType);
+var t: integer;
begin
+t:= cMaxSlotAmmoIndex;
with CurrentTeam^ do
with Hedgehogs[CurrHedgehog] do
- while Ammo[CurSlot, CurAmmo].AmmoType <> weap do
+ while (Ammo[CurSlot, CurAmmo].AmmoType <> weap) and (t > 0) do
+ begin
ParseCommand('/slot ' + chr(49 + Ammoz[TAmmoType(weap)].Slot));
+ dec(t)
+ end
end;
initialization