# HG changeset patch
# User unc0rr
# Date 1222642033 0
# Node ID d7fffad44b7eccce2a5cbbe534b2f1a996505011
# Parent  27bec661581cf84eea7af3cf72e0eeed0602aaaa
Prevent AI to damage a teammate when trying to dig with firepunch (patch not tested)

diff -r 27bec661581c -r d7fffad44b7e hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Sun Sep 28 22:39:07 2008 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Sun Sep 28 22:47:13 2008 +0000
@@ -364,7 +364,8 @@
 if (Abs(hwRound(Me^.X) - Targ.X) > 25)
 or (Abs(hwRound(Me^.Y) - 50 - Targ.Y) > 50) then
 	begin
-	if TestColl(hwRound(Me^.Y), hwRound(Me^.Y) - 16, 6) then
+	if TestColl(hwRound(Me^.Y), hwRound(Me^.Y) - 16, 6)
+	and (RateShove(Me, hwRound(Me^.X) + 10 * hwSign(Me^.dX), hwRound(Me^.Y) - 40, 30, 30) = 0) then
 		Result:= Succ(BadTurn)
 	else
 		Result:= BadTurn;