hedgewars/uTeams.pas
changeset 304 8096e69e839e
parent 295 8834f3cb620e
child 306 7b61834edcf6
--- a/hedgewars/uTeams.pas	Sun Dec 17 18:40:04 2006 +0000
+++ b/hedgewars/uTeams.pas	Sun Dec 17 20:50:49 2006 +0000
@@ -56,6 +56,7 @@
 
 var CurrentTeam: PTeam = nil;
     TeamsList: PTeam = nil;
+    CurMinAngle, CurMaxAngle: Longword;
 
 function AddTeam: PTeam;
 procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
@@ -232,6 +233,15 @@
 
 with Ammo[CurSlot, CurAmmo] do
      begin
+     CurMinAngle:= Ammoz[AmmoType].minAngle;
+     if Ammoz[AmmoType].maxAngle <> 0 then CurMaxAngle:= Ammoz[AmmoType].maxAngle
+                                      else CurMaxAngle:= cMaxAngle;
+     with Hedgehog.Gear^ do
+        begin
+        if Angle < CurMinAngle then Angle:= CurMinAngle;
+        if Angle > CurMaxAngle then Angle:= CurMaxAngle;
+        end;
+        
      s:= trammo[Ammoz[AmmoType].NameId];
      if Count <> AMMO_INFINITE then
         s:= s + ' (' + IntToStr(Count) + ')';