Add check for nil gear
authornemo
Tue, 10 Nov 2009 04:22:55 +0000
changeset 2611 07b0cc91256c
parent 2610 8c00c1ee6cac
child 2612 60c7691c348f
Add check for nil gear
hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Tue Nov 10 04:07:08 2009 +0000
+++ b/hedgewars/uGears.pas	Tue Nov 10 04:22:55 2009 +0000
@@ -629,7 +629,8 @@
 				// reset to default zoom
 				//ZoomValue:= ZoomDefault;
 				with CurrentHedgehog^ do
-					if ((Gear^.State and gstAttacked) = 0)
+					if (Gear <> nil) 
+                        and ((Gear^.State and gstAttacked) = 0)
 						and (MultiShootAttacks > 0) then OnUsedAmmo(CurrentHedgehog^);
 				
 				ResetUtilities;