hedgewars/HHHandlers.inc
changeset 5584 e0b9722bd653
parent 5564 4f42009237df
child 5612 2638dec1b323
--- a/hedgewars/HHHandlers.inc	Tue Aug 16 21:37:10 2011 -0400
+++ b/hedgewars/HHHandlers.inc	Tue Aug 16 23:02:27 2011 -0400
@@ -551,7 +551,13 @@
 case Gear^.Pos of
        posCaseUtility,
        posCaseAmmo: begin
-                    a:= Gear^.AmmoType;
+                    if Gear^.AmmoType <> amNothing then a:= Gear^.AmmoType 
+                    else
+                        begin
+                        for i:= 0 to GameTicks and $7F do GetRandom(2); // Burn some random numbers
+                        if Gear^.Pos = posCaseUtility then a:= GetUtility
+                        else a:= GetAmmo
+                        end;
                     AddAmmo(HH^.Hedgehog^, a);
 // Possibly needs to check shared clan ammo game flag once added.
 // On the other hand, no obvious reason that clan members shouldn't know what ammo another clan member picked up