hedgewars/uGears.pas
changeset 3098 e5a1bc4e56fd
parent 3097 6fa39c1c41b9
child 3100 5fe9c4ac4c99
--- a/hedgewars/uGears.pas	Sat Mar 27 04:02:02 2010 +0000
+++ b/hedgewars/uGears.pas	Sat Mar 27 05:15:52 2010 +0000
@@ -1884,6 +1884,14 @@
     i, tmpDmg: LongInt;
 begin
 t:= CheckGearsCollision(Ammo);
+// Just to avoid hogs on rope dodging fire.
+if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtRope) and 
+   (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.Gear^.CollisionIndex = -1) and 
+   (sqr(hwRound(Ammo^.X) - hwRound(CurrentHedgehog^.Gear^.X)) + sqr(hwRound(Ammo^.Y) - hwRound(CurrentHedgehog^.Gear^.Y)) <= sqr(cHHRadius + Ammo^.Radius)) then 
+    begin
+    t^.ar[t^.Count]:= CurrentHedgehog^.Gear;
+    inc(t^.Count)
+    end;
 i:= t^.Count;
 
 if (Ammo^.Kind = gtFlame) and (i > 0) then Ammo^.Health:= 0;