hedgewars/uAIAmmoTests.pas
branchwebgl
changeset 8026 4a4f21070479
parent 8013 5cbf6e4361f4
child 8096 453917e94e55
equal deleted inserted replaced
8023:7de85783b823 8026:4a4f21070479
   702     dx, dy: real;
   702     dx, dy: real;
   703 begin
   703 begin
   704     Targ:= Targ; // avoid compiler hint
   704     Targ:= Targ; // avoid compiler hint
   705 
   705 
   706     if Level < 3 then trackFall:= afTrackFall
   706     if Level < 3 then trackFall:= afTrackFall
   707     else trackFall:= 0;
   707         else trackFall:= 0;
   708 
   708 
   709     ap.ExplR:= 0;
   709     ap.ExplR:= 0;
   710     ap.Time:= 0;
   710     ap.Time:= 0;
   711     ap.Power:= 1;
   711     ap.Power:= 1;
   712     x:= hwRound(Me^.X);
   712     x:= hwRound(Me^.X);
  1045         begin
  1045         begin
  1046         if Me^.Health <= 100  then
  1046         if Me^.Health <= 100  then
  1047             begin
  1047             begin
  1048             maxTop := Targ.Y - cHHRadius * 2;
  1048             maxTop := Targ.Y - cHHRadius * 2;
  1049             
  1049             
  1050             while not TestColl(Targ.X, maxTop, cHHRadius) and (maxTop > topY + cHHRadius * 2 + 1) do
  1050             while (not TestColl(Targ.X, maxTop, cHHRadius)) and (maxTop > topY + cHHRadius * 2 + 1) do
  1051                 dec(maxTop, cHHRadius*2);
  1051                 dec(maxTop, cHHRadius*2);
  1052             if not TestColl(Targ.X, maxTop + cHHRadius, cHHRadius) then
  1052             if not TestColl(Targ.X, maxTop + cHHRadius, cHHRadius) then
  1053                 begin
  1053                 begin
  1054                 ap.AttackPutX := Targ.X;
  1054                 ap.AttackPutX := Targ.X;
  1055                 ap.AttackPutY := maxTop + cHHRadius;
  1055                 ap.AttackPutY := maxTop + cHHRadius;