hedgewars/GSHandlers.inc
changeset 911 b709fe13ed69
parent 883 07a568ba44e0
child 912 acab672fb1aa
--- a/hedgewars/GSHandlers.inc	Thu May 08 12:04:13 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Thu May 08 13:55:14 2008 +0000
@@ -457,8 +457,11 @@
 procedure doStepPickHammer(Gear: PGear);
 var i, y: LongInt;
     ar: TRangeArray;
+    HHGear: PGear;
 begin
 i:= 0;
+HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
+
 y:= hwRound(Gear^.Y) - cHHRadius * 2;
 while y < hwRound(Gear^.Y) do
    begin
@@ -467,8 +470,11 @@
    inc(y, 2);
    inc(i)
    end;
+
 DrawHLinesExplosions(@ar, 3, hwRound(Gear^.Y) - cHHRadius * 2, 2, Pred(i));
-Gear^.dY:= PHedgehog(Gear^.Hedgehog)^.Gear^.dY;
+Gear^.dY:= HHGear^.dY;
+DeleteCI(HHGear);
+
 PlaySound(sndPickhammer, true);
 doStepPickHammerWork(Gear);
 Gear^.doStep:= @doStepPickHammerWork
@@ -836,6 +842,7 @@
    begin
    DeleteGear(Gear);
    FreeActionsList;
+   SetAllHHToActive; // someone could be on top of the case
    with CurrentHedgehog^ do
      if Gear <> nil then Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump);
    exit