Disallow AI to hurts itself with mortar (in quite rare cases it tries to shoot directly up)
authorunc0rr
Fri, 08 Aug 2008 12:59:34 +0000
changeset 1176 2969efb7050f
parent 1175 34ffd3d99116
child 1177 fd1548b994fa
Disallow AI to hurts itself with mortar (in quite rare cases it tries to shoot directly up)
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Thu Aug 07 19:01:32 2008 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Fri Aug 08 12:59:34 2008 +0000
@@ -213,7 +213,7 @@
 			EY:= hwRound(y);
 		until TestColl(EX, EY, 5) or (EY > 1000);
 		
-		if EY < 1000 then
+		if (EY < 1000) and not dY.isNegative then
 			begin
 			Result:= RateExplosion(Me, EX, EY, 91);
 			if (Result = 0) then