I'm guessing this takes care of issue #689
authornemo
Tue, 13 Aug 2013 00:12:11 -0400
changeset 9385 dca86192d773
parent 9383 92e3fb58e1e1
child 9387 6478ed9ead25
I'm guessing this takes care of issue #689
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Fri Aug 02 00:06:44 2013 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Tue Aug 13 00:12:11 2013 -0400
@@ -1432,6 +1432,13 @@
     if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then
         dec(TurnTimeLeft);
 
+    if Gear^.Hedgehog^.Gear = nil then
+        begin
+        DeleteGear(Gear);
+        AfterAttack;
+        exit
+        end;
+
     HHGear := Gear^.Hedgehog^.Gear;
 
     HedgehogChAngle(HHGear);
@@ -1493,13 +1500,13 @@
         end;
 
     if b then
-    begin
+        begin
         DrawTunnel(HHGear^.X + Gear^.dX * cHHRadius,
         HHGear^.Y + Gear^.dY * cHHRadius - _1 -
         ((hwAbs(Gear^.dX) / (hwAbs(Gear^.dX) + hwAbs(Gear^.dY))) * _0_5 * 7),
         Gear^.dX, Gear^.dY,
         cHHStepTicks, cHHRadius * 2 + 7);
-    end;
+        end;
 
     if (TurnTimeLeft = 0) or (Gear^.Timer = 0)
     or ((HHGear^.Message and gmAttack) <> 0) then