# HG changeset patch # User unc0rr # Date 1308849583 -14400 # Node ID 67278f1cba2c0a6e8d3aa978632d4abced0315fb # Parent bf6d4bc531d2782580957d93d3132d4a9e4f80e6# Parent f9f75c5bc39562ce9aebf45a6e139e912a7833c0 merge diff -r f9f75c5bc395 -r 67278f1cba2c hedgewars/uAIMisc.pas --- a/hedgewars/uAIMisc.pas Thu Jun 23 21:14:41 2011 +0400 +++ b/hedgewars/uAIMisc.pas Thu Jun 23 21:19:43 2011 +0400 @@ -134,7 +134,7 @@ Gear:= GearsList; while Gear <> nil do begin - if (filter = []) or (Gear^.Kind in filter) then + if (filter = []) or (Gear^.Kind in filter) then case Gear^.Kind of gtCase: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 33, 25); gtFlame: if (Gear^.State and gsttmpFlag) <> 0 then @@ -152,7 +152,7 @@ AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 60, -25) else if isAfterAttack and (ThinkingHH^.Hedgehog <> Gear^.Hedgehog) then - if (MyClan = Gear^.Hedgehog^.Team^.Clan) then + if (ClansCount > 2) or (MyClan = Gear^.Hedgehog^.Team^.Clan) then AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -3) // hedgehog-friend else AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, 3) diff -r f9f75c5bc395 -r 67278f1cba2c hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Thu Jun 23 21:14:41 2011 +0400 +++ b/hedgewars/uCommandHandlers.pas Thu Jun 23 21:19:43 2011 +0400 @@ -26,7 +26,7 @@ procedure freeModule; implementation -uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom; +uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uRandom, uCaptions; procedure chGenCmd(var s: shortstring); begin @@ -331,7 +331,7 @@ FollowGear:= CurrentHedgehog^.Gear; if not CurrentTeam^.ExtDriven then SendIPC('A'); Message:= Message or (gmAttack and InputMask); - ScriptCall('onAttack'); + ScriptCall('onAttack'); end end end; @@ -411,7 +411,7 @@ begin Message:= Message or (gmWeapon and InputMask); MsgParam:= byte(s[1]); - ScriptCall('onSetWeapon'); + ScriptCall('onSetWeapon'); end; end; @@ -510,8 +510,18 @@ begin s:= s; // avoid compiler hint if CheckNoTeamOrHH or isPaused then exit; -bShowFinger:= true; -FollowGear:= CurrentHedgehog^.Gear + +if FollowGear <> nil then + begin + AddCaption('Auto Camera Off', $CCCCCC, capgrpVolume); + autoCameraOn:= false + end + else begin + AddCaption('Auto Camera On', $CCCCCC, capgrpVolume); + bShowFinger:= true; + FollowGear:= CurrentHedgehog^.Gear; + autoCameraOn:= true + end end; procedure chPause(var s: shortstring); diff -r f9f75c5bc395 -r 67278f1cba2c hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Thu Jun 23 21:14:41 2011 +0400 +++ b/hedgewars/uVariables.pas Thu Jun 23 21:19:43 2011 +0400 @@ -62,6 +62,7 @@ isFirstFrame : boolean; fastUntilLag : boolean; + autoCameraOn : boolean; GameState : TGameState; GameType : TGameType; @@ -2355,6 +2356,7 @@ fastUntilLag := false; isFirstFrame := true; isSEBackup := true; + autoCameraOn := true; cSeed := ''; cVolumeDelta := 0; cHasFocus := true; diff -r f9f75c5bc395 -r 67278f1cba2c hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Thu Jun 23 21:14:41 2011 +0400 +++ b/hedgewars/uWorld.pas Thu Jun 23 21:19:43 2011 +0400 @@ -1165,7 +1165,7 @@ {$ENDIF} if (not PlacingHogs) and (FollowGear <> nil) and (not isCursorVisible) and (not fastUntilLag) then - if abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4 then + if (not autoCameraOn) or (abs(CursorPoint.X - prevPoint.X) + abs(CursorPoint.Y - prevpoint.Y) > 4) then begin FollowGear:= nil; prevPoint:= CursorPoint;