hedgewars/GSHandlers.inc
changeset 5525 5fb06333314e
parent 5515 3768e9a6ec40
child 5531 52f4a5d9a222
--- a/hedgewars/GSHandlers.inc	Sun Aug 07 22:27:57 2011 +0400
+++ b/hedgewars/GSHandlers.inc	Sun Aug 07 14:29:11 2011 -0400
@@ -2942,10 +2942,26 @@
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepSeductionWork(Gear: PGear);
 var 
-    x, y: LongInt;
+    x, y, i: LongInt;
+    hogs: TPGearArray;
+    d: hwFloat;
 begin
     AllInactive := false;
-
+    hogs := GearsNear(Gear^.X, Gear^.Y, gtHedgehog, Gear^.Radius);
+    if Length(hogs) > 0 then
+        begin
+        for i:= 0 to High(hogs) do
+            begin
+            //d:= Distance(Gear^.X - hogs[i]^.X, Gear^.Y - hogs[i]^.Y);
+            hogs[i]^.dX:= _0_25 * (Gear^.X - hogs[i]^.X) / _250;
+            //if Gear^.X < hogs[i]^.X then hogs[i]^.dX.isNegative:= true;
+            hogs[i]^.dY:= -_0_25;
+            hogs[i]^.Active:= true;
+            end;
+        end ;
+        AfterAttack;
+        DeleteGear(Gear);
+(*
     Gear^.X := Gear^.X + Gear^.dX;
     Gear^.Y := Gear^.Y + Gear^.dY;
     x := hwRound(Gear^.X);
@@ -2967,7 +2983,7 @@
         begin
         AfterAttack;
         DeleteGear(Gear)
-        end
+        end*)
 end;
 
 procedure doStepSeductionWear(Gear: PGear);
@@ -2989,7 +3005,7 @@
 procedure doStepSeduction(Gear: PGear);
 begin
     AllInactive := false;
-    DeleteCI(Gear^.Hedgehog^.Gear);
+    //DeleteCI(Gear^.Hedgehog^.Gear);
     Gear^.doStep := @doStepSeductionWear
 end;