hedgewars/uGearsHedgehog.pas
changeset 12917 a840fd55caa6
parent 12903 8a40ce061d94
child 12942 a84a05719454
--- a/hedgewars/uGearsHedgehog.pas	Wed Feb 07 02:26:31 2018 +0100
+++ b/hedgewars/uGearsHedgehog.pas	Wed Feb 07 03:50:38 2018 +0100
@@ -141,6 +141,16 @@
 weap:= TAmmoType(HHGear^.MsgParam);
 Hedgehog:= HHGear^.Hedgehog;
 
+HHGear^.Message:= HHGear^.Message and (not gmWeapon);
+
+// Special case: amNothing unselects weapon
+if weap = amNothing then
+    begin
+    HHGear^.Hedgehog^.CurAmmoType:= amNothing;
+    ApplyAmmoChanges(HHGear^.Hedgehog^);
+    exit
+    end;
+
 if Hedgehog^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then
     exit; // weapon is not activated yet
 
@@ -148,8 +158,6 @@
 
 t:= cMaxSlotAmmoIndex;
 
-HHGear^.Message:= HHGear^.Message and (not gmWeapon);
-
 prevState:= HHGear^.State;
 newState:= prevState;
 with Hedgehog^ do