hedgewars/uGearsHandlersMess.pas
changeset 15722 498c1482dec2
parent 15721 1244c64b8e28
child 15723 4e65fd69f58c
--- a/hedgewars/uGearsHandlersMess.pas	Sun Jul 12 01:08:42 2020 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Sun Jul 12 01:27:27 2020 +0300
@@ -7388,16 +7388,20 @@
 
     if Gear^.dY.isNegative or (TestCollisionYwithGear(Gear, 1) = 0) then
     begin
+        DeleteCI(Gear);
         doStepFallingGear(Gear);
         if not (Gear^.Tag in [sentry_Idle, sentry_Reloading]) then
             ResetSentryState(Gear, sentry_Idle, 1000);
         exit;
-    end;
+    end
+    else
+        AddCI(Gear);
 
     if Gear^.Timer > 0 then dec(Gear^.Timer);
 
     if Gear^.Timer = 0 then
     begin
+        DeleteCI(Gear);
         if Gear^.Tag = sentry_Idle then
         begin
             Gear^.Tag := sentry_Walking;
@@ -7474,12 +7478,15 @@
                 Gear^.Timer := 100;
             end
         end;
+        AddCI(Gear);
     end;
 
     if (Gear^.Tag = sentry_Walking) and ((GameTicks and $1F) = 0) then
     begin
+        DeleteCI(Gear);
         if not MakeSentryStep(Gear, 6, false) then
-            Gear^.Timer := 0
+            Gear^.Timer := 0;
+        AddCI(Gear);
     end;
 
     if ((GameTicks and $1F) = 0) and (Gear^.Tag = sentry_Aiming) then