Specifically check for current hedgehog being on rope, the tricky bastard.
authornemo
Sat, 27 Mar 2010 05:15:52 +0000
changeset 3098 e5a1bc4e56fd
parent 3097 6fa39c1c41b9
child 3099 cc13b42ab593
Specifically check for current hedgehog being on rope, the tricky bastard.
hedgewars/uGears.pas
--- 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;