# HG changeset patch
# User sheepluva
# Date 1277754720 -7200
# Node ID 4debed8656d72eb42647bf5d0edcad589968f074
# Parent  8cdf8f57780012dabc04f00215cf6290073add05
fix segfault on HH-gear being 0 (e.g. after drowning) in cursor/target selection mode, thanks "ivze" for the heads-up!

diff -r 8cdf8f577800 -r 4debed8656d7 hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Mon Jun 28 21:49:59 2010 +0400
+++ b/hedgewars/uWorld.pas	Mon Jun 28 21:52:00 2010 +0200
@@ -596,7 +596,6 @@
 DrawWater(255, 0);
 
 // Attack bar
-// TODO: Add weapon offset
 if CurrentTeam <> nil then
     case AttackBar of
 (*        1: begin
@@ -974,7 +973,7 @@
    if not bShowAmmoMenu then
      begin
      with CurrentHedgehog^ do
-       if (Gear^.State and gstHHChooseTarget) <> 0 then
+       if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then
          begin
          i:= Ammo^[CurSlot, CurAmmo].Pos;
          with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do