Allow AfterAttack to proceed even if the Hedgehog is dead. They could be resurrected after all.
--- 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;