# HG changeset patch # User sheepluva # Date 1418590494 -3600 # Node ID c2004c3e9c7d7312b27bd6d14763f1a127f5e05e # Parent 17dd6265a08abcdce96e9932476b8d7791b4dfce Issue 768: Bee: Camera focus lost diff -r 17dd6265a08a -r c2004c3e9c7d hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Sun Dec 14 20:11:36 2014 +0100 +++ b/hedgewars/uCommandHandlers.pas Sun Dec 14 21:54:54 2014 +0100 @@ -323,6 +323,7 @@ end; procedure chAttack_p(var s: shortstring); +var inbtwnTrgtAttks: Boolean; begin s:= s; // avoid compiler hint if CheckNoTeamOrHH then @@ -333,7 +334,9 @@ AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State)); if ((State and gstHHDriven) <> 0) then begin - FollowGear:= CurrentHedgehog^.Gear; + inbtwnTrgtAttks:= ((GameFlags and gfInfAttack) <> 0) and ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0); + if (not inbtwnTrgtAttks) then + FollowGear:= CurrentHedgehog^.Gear; if not isExternalSource then SendIPC(_S'A'); Message:= Message or (gmAttack and InputMask); diff -r 17dd6265a08a -r c2004c3e9c7d hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Sun Dec 14 20:11:36 2014 +0100 +++ b/hedgewars/uWorld.pas Sun Dec 14 21:54:54 2014 +0100 @@ -1857,7 +1857,7 @@ uCursor.updatePosition(); {$ENDIF} z:= round(200/zoom); -inbtwnTrgtAttks := (CurrentHedgehog <> nil) and ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0) and ((GameFlags and gfInfAttack) <> 0); +inbtwnTrgtAttks := ((GameFlags and gfInfAttack) <> 0) and (CurrentHedgehog <> nil) and ((CurrentHedgehog^.Gear = nil) or (CurrentHedgehog^.Gear <> FollowGear)) and ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0); if autoCameraOn and (not PlacingHogs) and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) and (not inbtwnTrgtAttks) then if ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then begin