hedgewars/uAmmos.pas
changeset 2716 b9ca1bfca24f
parent 2715 0e4e0db79e2a
child 2730 f56592281526
--- a/hedgewars/uAmmos.pas	Tue Jan 26 04:13:37 2010 +0000
+++ b/hedgewars/uAmmos.pas	Tue Jan 26 21:55:51 2010 +0000
@@ -22,7 +22,9 @@
 interface
 uses uConsts, uTeams;
 
+procedure init_uAmmos;
 procedure free_uAmmos;
+
 procedure AddAmmoStore(s: shortstring);
 procedure AssignStores;
 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
@@ -35,13 +37,14 @@
 procedure SetWeapon(weap: TAmmoType);
 procedure DisableSomeWeapons;
 
-var shoppa: Boolean = false;
+var shoppa: boolean;
 
 implementation
 uses uMisc, uGears, uWorld, uLocale, uConsole;
+
 type TAmmoCounts = array[TAmmoType] of Longword;
 var StoresList: array[0..Pred(cMaxHHs)] of PHHAmmo;
-    StoreCnt: Longword = 0;
+    StoreCnt: Longword;
 
 procedure FillAmmoStore(Ammo: PHHAmmo; var cnts: TAmmoCounts);
 var mi: array[0..cMaxSlotIndex] of byte;
@@ -317,11 +320,17 @@
 	if (Ammoz[t].Ammo.Propz and ammoprop_NotBorder) <> 0 then Ammoz[t].Probability:= 0
 end;
 
+procedure init_uAmmos;
+begin
+	shoppa:= false;
+	StoreCnt:= 0
+end;
+
 procedure free_uAmmos;
 var i: LongWord;
 begin
-for i:= 0 to Pred(StoreCnt) do Dispose(StoresList[i]);
-StoreCnt:= 0
+	for i:= 0 to Pred(StoreCnt) do Dispose(StoresList[i]);
+	StoreCnt:= 0
 end;
 
 end.