another nil check
authornemo
Wed, 24 Feb 2010 16:41:35 +0000
changeset 2859 d44ae883896b
parent 2858 4c5c4bc0ae35
child 2860 13a53315ae18
another nil check
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Wed Feb 24 13:46:02 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Wed Feb 24 16:41:35 2010 +0000
@@ -574,9 +574,12 @@
 if (HHGear^.Message and gm_Attack) <> 0 then
     begin
     shell:= AddVisualGear(hwRound(Gear^.x), hwRound(Gear^.y), vgtShell);
-    shell^.dX:= gear^.dX / -2;
-    shell^.dY:= gear^.dY / -2;
-    shell^.Frame:= 1;
+    if shell <> nil then
+       begin
+       shell^.dX:= gear^.dX / -2;
+       shell^.dY:= gear^.dY / -2;
+       shell^.Frame:= 1
+       end;
     Gear^.State:= Gear^.State or gstAnimation;
     Gear^.dX:= SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _0_5;
     Gear^.dY:= -AngleCos(HHGear^.Angle) * _0_5;