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.
authornemo
Sun, 21 Nov 2010 01:08:43 -0500
changeset 4391 de9e1a5102b4
parent 4390 f219628ed666
child 4392 95e27e12d0e9
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.
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