hedgewars/uGears.pas
changeset 955 474afaab0365
parent 954 0cc31e998f4e
child 956 19003f7fc174
--- a/hedgewars/uGears.pas	Mon May 26 22:47:48 2008 +0000
+++ b/hedgewars/uGears.pas	Tue May 27 14:30:48 2008 +0000
@@ -904,7 +904,7 @@
 
 procedure ShotgunShot(Gear: PGear);
 var t: PGear;
-    dmg: integer;
+    dmg: LongInt;
 begin
 Gear^.Radius:= cShotgunRadius;
 t:= GearsList;
@@ -972,44 +972,46 @@
 end;
 
 procedure AssignHHCoords;
-var i, t, p: LongInt;
+var i, t, p, j: LongInt;
     ar: array[0..Pred(cMaxHHs)] of PGear;
     Count: Longword;
 begin
 if (GameFlags and gfForts) <> 0 then
-   begin
-   t:= 0;
-   for p:= 0 to Pred(TeamsCount) do
-     with TeamsArray[p]^ do
-      begin
-      for i:= 0 to cMaxHHIndex do
-          with Hedgehogs[i] do
-               if (Gear <> nil) and (Gear^.X.QWordValue = 0) then FindPlace(Gear, false, t, t + 1024);
-      inc(t, 1024);
-      end
-   end else // mix hedgehogs
-   begin
-   Count:= 0;
-   for p:= 0 to Pred(TeamsCount) do
-     with TeamsArray[p]^ do
-      begin
-      for i:= 0 to cMaxHHIndex do
-          with Hedgehogs[i] do
-               if (Gear <> nil) and (Gear^.X.QWordValue = 0) then
-                  begin
-                  ar[Count]:= Gear;
-                  inc(Count)
-                  end;
-      end;
+	begin
+	t:= 0;
+	for p:= 0 to 1 do
+		begin
+		with ClansArray[p]^ do
+			for j:= 0 to Pred(TeamsNumber) do
+				with Teams[j]^ do
+					for i:= 0 to cMaxHHIndex do
+						with Hedgehogs[i] do
+							if (Gear <> nil) and (Gear^.X.QWordValue = 0) then FindPlace(Gear, false, t, t + 1024);
+		inc(t, 1024)
+		end
+	end else // mix hedgehogs
+	begin
+	Count:= 0;
+	for p:= 0 to Pred(TeamsCount) do
+		with TeamsArray[p]^ do
+		begin
+		for i:= 0 to cMaxHHIndex do
+			with Hedgehogs[i] do
+				if (Gear <> nil) and (Gear^.X.QWordValue = 0) then
+					begin
+					ar[Count]:= Gear;
+					inc(Count)
+					end;
+		end;
 
-   while (Count > 0) do
-      begin
-      i:= GetRandom(Count);
-      FindPlace(ar[i], false, 0, 2048);
-      ar[i]:= ar[Count - 1];
-      dec(Count)
-      end
-   end
+	while (Count > 0) do
+		begin
+		i:= GetRandom(Count);
+		FindPlace(ar[i], false, 0, 2048);
+		ar[i]:= ar[Count - 1];
+		dec(Count)
+		end
+	end
 end;
 
 function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear;