Fix desync when dropping weapon from parachute or jetpack
authorWuzzy <Wuzzy2@mail.ru>
Fri, 03 Nov 2017 04:14:33 +0100
changeset 12825 4c1c468725ff
parent 12824 3fc7569c1203
child 12826 f3e07e53460d
Fix desync when dropping weapon from parachute or jetpack
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Fri Nov 03 02:23:41 2017 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Fri Nov 03 04:14:33 2017 +0100
@@ -2628,7 +2628,7 @@
             end;
         DeleteGear(Gear);
         if (GetAmmoEntry(HHGear^.Hedgehog^, amParachute)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
-            SetWeapon(amParachute);
+            HHGear^.Hedgehog^.CurAmmoType:= amParachute;
         isCursorVisible := false;
         ApplyAmmoChanges(HHGear^.Hedgehog^);
         exit
@@ -4051,7 +4051,7 @@
                 end;
             DeleteGear(Gear);
             if (GetAmmoEntry(HHGear^.Hedgehog^, amJetpack)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
-                SetWeapon(amJetpack);
+                HHGear^.Hedgehog^.CurAmmoType:= amJetpack;
             isCursorVisible := false;
             ApplyAmmoChanges(HHGear^.Hedgehog^);
         //    if Gear^.Tex <> nil then FreeTexture(Gear^.Tex);