Toggle autoCameraOn in Findhh instead of checking FollowGear which could be set in a variety of places. Issue #404
authornemo
Wed, 01 Aug 2012 18:35:09 -0400
changeset 7468 1333ca7554dc
parent 7465 c2dcf97ca664
child 7471 ce5d3e39361e
Toggle autoCameraOn in Findhh instead of checking FollowGear which could be set in a variety of places. issue #404
hedgewars/GSHandlers.inc
hedgewars/uCommandHandlers.pas
hedgewars/uWorld.pas
--- a/hedgewars/GSHandlers.inc	Tue Jul 31 23:29:00 2012 +0400
+++ b/hedgewars/GSHandlers.inc	Wed Aug 01 18:35:09 2012 -0400
@@ -3685,10 +3685,6 @@
 
     Gear^.X := HHGear^.X;
     Gear^.Y := HHGear^.Y;
-    // For some reason I need to reapply followgear here, something else grabs it otherwise.
-    // This is probably not needed anymore
-    if not CurrentTeam^.ExtDriven then
-        FollowGear := HHGear;
 
     if not isUnderWater and hasBorder and ((HHGear^.X < _0)
     or (hwRound(HHGear^.X) > LAND_WIDTH)) then
--- a/hedgewars/uCommandHandlers.pas	Tue Jul 31 23:29:00 2012 +0400
+++ b/hedgewars/uCommandHandlers.pas	Wed Aug 01 18:35:09 2012 -0400
@@ -614,13 +614,14 @@
 if CheckNoTeamOrHH or isPaused then
     exit;
 
-if FollowGear <> nil then
+if autoCameraOn then
     begin
+    FollowGear:= nil;
     AddCaption('Auto Camera Off', $CCCCCC, capgrpVolume);
     autoCameraOn:= false
     end
-    else
-        begin
+else
+    begin
     AddCaption('Auto Camera On', $CCCCCC, capgrpVolume);
     bShowFinger:= true;
     if not CurrentHedgehog^.Unplaced then
--- a/hedgewars/uWorld.pas	Tue Jul 31 23:29:00 2012 +0400
+++ b/hedgewars/uWorld.pas	Wed Aug 01 18:35:09 2012 -0400
@@ -1614,10 +1614,7 @@
     uCursor.updatePosition();
 {$ENDIF}
 z:= round(200/zoom);
-if not PlacingHogs and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) then
-    if (not autoCameraOn) then
-        FollowGear:= nil
-    else
+if not PlacingHogs and (FollowGear <> nil) and (not isCursorVisible) and (not bShowAmmoMenu) and (not fastUntilLag) and autoCameraOn then
     if ((abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y)) > 4) then
         begin
         FollowGear:= nil;