Fallback to old heuristic if not pit position
authorunc0rr
Wed, 11 Jun 2014 00:35:23 +0400
changeset 10274 07adc8b6288c
parent 10273 99032c5be7ba
child 10275 6c91047f59b6
Fallback to old heuristic if not pit position
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsUtils.pas	Tue Jun 10 22:35:44 2014 +0200
+++ b/hedgewars/uGearsUtils.pas	Wed Jun 11 00:35:23 2014 +0400
@@ -654,7 +654,9 @@
                 if (y - sy > Gear^.Radius * 2) and (y < cWaterLine)
                     and (((Gear^.Kind = gtExplosives)
                         and (ignoreNearObjects or NoGearsToAvoid(x, y - Gear^.Radius, 60, 60))
-                        and (isSteadyPosition(x, y+1, Gear^.Radius - 1, 3, $FFFF)))
+                        and (isSteadyPosition(x, y+1, Gear^.Radius - 1, 3, $FFFF)
+                         or (CountNonZeroz(x, y+1, Gear^.Radius - 1, Gear^.Radius+1, $FFFF) > Gear^.Radius)
+                            ))
                     or
                         ((Gear^.Kind <> gtExplosives)
                         and (ignoreNearObjects or NoGearsToAvoid(x, y - Gear^.Radius, 110, 110))