AI: Laser sight removes upper range cap for shotgun
authorWuzzy <Wuzzy2@mail.ru>
Wed, 08 Jul 2020 19:11:00 +0200
changeset 15728 f2930fe1b6d0
parent 15727 7c69b242d971
child 15729 26c6e5325075
AI: Laser sight removes upper range cap for shotgun
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Wed Jul 08 18:51:18 2020 +0200
+++ b/hedgewars/uAIAmmoTests.pas	Wed Jul 08 19:11:00 2020 +0200
@@ -999,7 +999,8 @@
 x:= hwFloat2Float(Me^.X);
 y:= hwFloat2Float(Me^.Y);
 range:= Metric(trunc(x), trunc(y), Targ.Point.X, Targ.Point.Y);
-if ( range < MIN_RANGE ) or ( range > MAX_RANGE ) then
+// Range limits (laser sight can remove upper range limit)
+if (range < MIN_RANGE) or ((range > MAX_RANGE) and (not aiLaserSighting) and (Level >= 4))then
     exit(BadTurn);
 
 Vx:= (Targ.Point.X - x) * 1 / 1024;