# HG changeset patch
# User nemo
# Date 1343431659 14400
# Node ID 8511a3f899d3b7cc8f9d0fdbd11c7ea56667b6fe
# Parent  823bd65ef09587f764d7823de25ff9d0a7e737c4
Allow AfterAttack to proceed even if the Hedgehog is dead.  They could be resurrected after all.

diff -r 823bd65ef095 -r 8511a3f899d3 hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Fri Jul 27 20:45:02 2012 +0400
+++ b/hedgewars/uGearsHedgehog.pas	Fri Jul 27 19:27:39 2012 -0400
@@ -455,11 +455,13 @@
 procedure AfterAttack;
 var s: shortstring;
     a: TAmmoType;
+    HHGear: PGear;
 begin
-with CurrentHedgehog^.Gear^, CurrentHedgehog^ do
+with CurrentHedgehog^ do
     begin
+    HHGear:= Gear;
     a:= CurAmmoType;
-    State:= State and (not gstAttacking);
+    if HHGear <> nil then HHGear^.State:= HHGear^.State and (not gstAttacking);
     if (Ammoz[a].Ammo.Propz and ammoprop_Effect) = 0 then
         begin
         Inc(MultiShootAttacks);
@@ -484,8 +486,8 @@
                     TagTurnTimeLeft:= TurnTimeLeft;
                 TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100;
                 end;
-            if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) then
-                State:= State or gstAttacked;
+            if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (HHGear <> nil) then 
+                HHGear^.State:= HHGear^.State and (not gstAttacked);
             if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then
                 ApplyAmmoChanges(CurrentHedgehog^)
             end;