hedgewars/uScript.pas
changeset 12371 2b1dd699b371
parent 12360 a775a61e02ab
child 12454 a675a94b5cc1
--- a/hedgewars/uScript.pas	Fri Apr 28 00:21:16 2017 +0200
+++ b/hedgewars/uScript.pas	Fri Apr 28 02:18:21 2017 +0200
@@ -1638,8 +1638,14 @@
                 end;
 
             SwitchCurrentHedgehog(gear^.Hedgehog);
+            AmmoMenuInvalidated:= true;
             CurrentTeam:= CurrentHedgehog^.Team;
 
+            repeat
+                CurrentTeam^.CurrHedgehog := (CurrentTeam^.CurrHedgehog + 1) mod CurrentTeam^.HedgehogsNumber
+            until
+                CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear = CurrentHedgehog^.Gear;
+
             gear^.State:= gear^.State or gstHHDriven;
             gear^.Active := true;
             gear^.Z := cCurrHHZ;