verify impact before explosion rating, since the offsets might cause water splashes
authornemo
Sat, 17 Nov 2018 14:29:09 -0500
changeset 14241 d5d941737a65
parent 14240 de21f6eb2366
child 14242 6b7997406121
verify impact before explosion rating, since the offsets might cause water splashes
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Sat Nov 17 19:19:50 2018 +0100
+++ b/hedgewars/uAIAmmoTests.pas	Sat Nov 17 14:29:09 2018 -0500
@@ -183,9 +183,13 @@
 
         EX:= trunc(x);
         EY:= trunc(y);
-        if Level = 1 then
-            value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand)
-        else value:= RateExplosion(Me, EX, EY, 101);
+        if (((Me = CurrentHedgehog^.Gear) and TestColl(EX, EY, 3)) or
+               ((Me <> CurrentHedgehog^.Gear) and TestCollExcludingMe(Me^.Hedgehog^.Gear, EX, EY, 3))) then
+			begin
+			if Level = 1 then
+				 value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand)
+			else value:= RateExplosion(Me, EX, EY, 101);
+			end;
         if (value = 0) and (Targ.Kind = gtHedgehog) and (Targ.Score > 0) then
             if GameFlags and gfSolidLand = 0 then
                  value := 1024 - Metric(Targ.Point.X, Targ.Point.Y, EX, EY) div 64