# HG changeset patch # User nemo # Date 1289487490 18000 # Node ID 6f1631765ebd311c8a54310d006e314f1b9780b0 # Parent ef9b201c97fe063908a28474f00579110ffba49c Fix a long-standing bug with ammo due to gstMoving being set on gears generically, causing an incorrect ammo type to be set. This caused crashes and incorrect ammo types. diff -r ef9b201c97fe -r 6f1631765ebd hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Thu Nov 11 00:38:12 2010 +0100 +++ b/hedgewars/HHHandlers.inc Thu Nov 11 09:58:10 2010 -0500 @@ -451,7 +451,7 @@ case Gear^.Pos of posCaseUtility, posCaseAmmo: begin - a:= TAmmoType(Gear^.State); + a:= Gear^.AmmoType; AddAmmo(PHedgehog(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 diff -r ef9b201c97fe -r 6f1631765ebd hedgewars/uGears.pas --- a/hedgewars/uGears.pas Thu Nov 11 00:38:12 2010 +0100 +++ b/hedgewars/uGears.pas Thu Nov 11 09:58:10 2010 -0500 @@ -1748,7 +1748,7 @@ dec(t, Ammoz[i].Probability) end; FollowGear^.Pos:= posCaseAmmo; - FollowGear^.State:= Longword(i); + FollowGear^.AmmoType:= i; AddCaption(GetEventString(eidNewAmmoPack), cWhiteColor, capgrpAmmoInfo); end end @@ -1767,7 +1767,7 @@ dec(t, Ammoz[i].Probability) end; FollowGear^.Pos:= posCaseUtility; - FollowGear^.State:= Longword(i); + FollowGear^.AmmoType:= i; AddCaption(GetEventString(eidNewUtilityPack), cWhiteColor, capgrpAmmoInfo); end end;