--- 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