Ensure InitialCount gets a value
authornemo
Tue, 16 Feb 2010 03:03:26 +0000
changeset 2819 8c3f078bc67d
parent 2818 df7ec369992b
child 2820 389e8b286afe
Ensure InitialCount gets a value
hedgewars/uAmmos.pas
--- a/hedgewars/uAmmos.pas	Tue Feb 16 02:23:12 2010 +0000
+++ b/hedgewars/uAmmos.pas	Tue Feb 16 03:03:26 2010 +0000
@@ -55,6 +55,7 @@
 FillChar(Ammo^, sizeof(Ammo^), 0);
 for a:= Low(TAmmoType) to High(TAmmoType) do
     begin
+    Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].InitialCount:= 0;
     if cnts[a] > 0 then
        begin
        TryDo(mi[Ammoz[a].Slot] <= cMaxSlotAmmoIndex, 'Ammo slot overflow', true);
@@ -73,7 +74,6 @@
        Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]]:= Ammoz[a].Ammo;
 
        Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].Count:= AMMO_INFINITE;
-       Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].InitialCount:= 0;
 
        inc(mi[Ammoz[a].Slot])
        end