Fix issue with hedgehog on top of the hedgehog with pickhammer
authorunc0rr
Thu, 08 May 2008 13:55:14 +0000
changeset 911 b709fe13ed69
parent 910 8d5f3fef4ac2
child 912 acab672fb1aa
Fix issue with hedgehog on top of the hedgehog with pickhammer
hedgewars/GSHandlers.inc
--- 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