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.
--- 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);