# HG changeset patch
# User nemo
# Date 1290319723 18000
# Node ID de9e1a5102b4ee006f0b82e7605361d95c099b7c
# Parent  f219628ed666a893e93b28af819d3fc70805ea14
In the case of per-hog-ammo, switch the ammo viewed when not your turn to what will probably be your ammo, assuming that hog survives.

diff -r f219628ed666 -r de9e1a5102b4 hedgewars/uTeams.pas
--- a/hedgewars/uTeams.pas	Sat Nov 20 23:55:00 2010 +0300
+++ b/hedgewars/uTeams.pas	Sun Nov 21 01:08:43 2010 -0500
@@ -122,6 +122,19 @@
         InsertGearToList(Gear)
         end
     end;
+// Try to make the ammo menu viewed when not your turn be a bit more useful for per-hog-ammo mode
+with CurrentTeam^ do
+    if ((GameFlags and gfPerHogAmmo) <> 0) and (not ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then
+        begin
+        c:= CurrHedgehog;
+        repeat
+            begin
+            inc(c);
+            if c > cMaxHHIndex then c:= 0
+            end
+        until (c = CurrHedgehog) or (Hedgehogs[c].Gear <> nil);
+        LocalAmmo:= Hedgehogs[c].AmmoStore
+        end;
 
 c:= CurrentTeam^.Clan^.ClanIndex;
 repeat