Add back accidental removal of random mines
authorWuzzy <almikes@aol.com>
Thu, 06 Apr 2017 20:14:05 +0200
changeset 12171 115867d77982
parent 12170 8ad74d50f0a0
child 12172 fe2946e2a859
Add back accidental removal of random mines
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Thu Apr 06 20:01:14 2017 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Apr 06 20:14:05 2017 +0200
@@ -1752,6 +1752,14 @@
         else // gstAttacking <> 0
             begin
             AllInactive := false;
+            // tag of 1 means this mine has a random timer
+            if (Gear^.Tag = 1) and (Gear^.Timer = 0) then
+                begin
+                if (GameTicks mod 2 = 0) then GetRandom(2);
+                if (GameTicks mod 3 = 0) then GetRandom(2);
+                Gear^.Timer:= GetRandom(51) * 100;
+                Gear^.Tag:= 0;
+                end;
             if (Gear^.Timer and $FF) = 0 then
                 PlaySound(sndMineTick);
             if Gear^.Timer = 0 then