# HG changeset patch # User Wuzzy # Date 1508619832 -7200 # Node ID 353cb2ce6f9c8539839e0d88457b9e1f23e71671 # Parent e7ed1b91c68bf164c74e9ff3ab116fc8e2532e59 Fix AddAmmo setting ammo to 99 when trying to add infinite ammo This affected the portal mission, the crate only gave you 99 portal guns instead of infinite. diff -r e7ed1b91c68b -r 353cb2ce6f9c hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Sat Oct 21 16:47:20 2017 -0400 +++ b/hedgewars/uAmmos.pas Sat Oct 21 23:03:52 2017 +0200 @@ -210,11 +210,11 @@ cnt:= a^.Count else cnt:= 0; -if (cnt <> AMMO_INFINITE) then - begin +if (cnt >= AMMO_INFINITE) or (amt >= AMMO_INFINITE) then + cnt:= AMMO_INFINITE +else cnt:= min(AMMO_FINITE_MAX, cnt + amt); - SetAmmo(Hedgehog, ammo, cnt) - end +SetAmmo(Hedgehog, ammo, cnt); end; procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);