# HG changeset patch # User unc0rr # Date 1343370577 -14400 # Node ID 4be946b65a85bc3be21862be061a77920bb24cb8 # Parent 9ce6e2c35413f3c6ca0c1258495a88df46878cfb Fix edge case problems with sniper rifle diff -r 9ce6e2c35413 -r 4be946b65a85 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Thu Jul 26 11:56:58 2012 +0400 +++ b/hedgewars/uAI.pas Fri Jul 27 10:29:37 2012 +0400 @@ -178,9 +178,12 @@ begin AddAction(BestActions, aia_attack, aim_push, 350 + random(200), 0, 0); AddAction(BestActions, aia_attack, aim_release, 1, 0, 0); - - AddAction(BestActions, aia_Down, aim_push, 100 + random(150), 0, 0); - AddAction(BestActions, aia_Down, aim_release, 32, 0, 0); + + if ap.Angle > 32 then + begin + AddAction(BestActions, aia_Down, aim_push, 100 + random(150), 0, 0); + AddAction(BestActions, aia_Down, aim_release, 32, 0, 0); + end; AddAction(BestActions, aia_waitAngle, ap.Angle, 250, 0, 0); AddAction(BestActions, aia_attack, aim_push, 1, 0, 0);