add a nilcheck
authorkoda
Mon, 21 May 2012 22:54:34 +0200
changeset 7105 9007531f813f
parent 7104 2468316c1d9d
child 7106 aacb90365d3d
add a nilcheck
hedgewars/uTouch.pas
--- a/hedgewars/uTouch.pas	Mon May 21 16:46:24 2012 -0400
+++ b/hedgewars/uTouch.pas	Mon May 21 22:54:34 2012 +0200
@@ -271,7 +271,7 @@
                 ParseTeamCommand('put');
                 targetted:= true;
                 end
-            else if CurAmmoGear^.AmmoType = amSwitch then
+            else if (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amSwitch) then
                 ParseTeamCommand('switch')
             else WriteLnToConsole(inttostr(ord(Ammoz[CurrentHedgehog^.CurAmmoType].NameId)) + ' ' + inttostr(ord(sidSwitch)));
     end;