# HG changeset patch # User nemo # Date 1312732326 14400 # Node ID 13a222b00a9da529d3e69aee2086083ccdb82f7f # Parent 3b344484883e73f036320d767b08549263d234cc prevent attempting to teleport in mid-air during inf attack diff -r 3b344484883e -r 13a222b00a9d hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Sun Aug 07 11:23:27 2011 -0400 +++ b/hedgewars/HHHandlers.inc Sun Aug 07 11:52:06 2011 -0400 @@ -376,8 +376,7 @@ if Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then begin newGear^.TargetX:= TargetPoint.X; - newGear^.TargetY:= TargetPoint.Y; - TargetPoint.X := NoPointX + newGear^.TargetY:= TargetPoint.Y end; // Clear FollowGear if using on a rope/parachute/saucer etc so focus stays with the hog's movement @@ -422,7 +421,8 @@ AfterAttack; end end else Message:= Message and not gmAttack; - end + end; + TargetPoint.X := NoPointX end; procedure AfterAttack; diff -r 3b344484883e -r 13a222b00a9d hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Aug 07 11:23:27 2011 -0400 +++ b/hedgewars/uGears.pas Sun Aug 07 11:52:06 2011 -0400 @@ -917,11 +917,12 @@ if ((delay2 mod cInactDelay) = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and not CurrentHedgehog^.Unplaced then begin - if (CurrentHedgehog^.Gear^.State and gstAttacked <> 0) and (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then + if (CurrentHedgehog^.Gear^.State and (gstAttacked or gstMoving) = gstAttacked) and (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then begin CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State or gstHHChooseTarget; isCursorVisible := true end; + if (CurrentHedgehog^.Gear^.State and gstMoving = 0) or (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget = 0) then CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstAttacked; end; if delay2 = 0 then