hedgewars/uGearsHandlersMess.pas
changeset 12644 59b46e6f36ff
parent 12641 f30b70976577
child 12656 161c10db4f27
--- a/hedgewars/uGearsHandlersMess.pas	Wed Oct 04 16:09:28 2017 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Wed Oct 04 18:34:02 2017 +0200
@@ -4182,8 +4182,9 @@
         dec(Gear^.Timer, 1);
 
     HHGear := Gear^.Hedgehog^.Gear;
-    if HHGear = nil then
-        begin
+    if (HHGear = nil) or ((HHGear^.State and gstHHDriven) = 0) then
+        begin
+        Gear^.Hedgehog := nil;
         Gear^.Timer := 0;
         Gear^.State := Gear^.State or gstAnimation or gstTmpFlag;
         Gear^.Timer := 0;