# HG changeset patch
# User alfadur
# Date 1594418996 -10800
# Node ID 7a4b719ac611a53b24bafbeba9cb12a45bf63ba5
# Parent  73c4e7d47575b063687ef0105fa65d3f91a0f26a
prevent sentries from getting stuck in the corners

diff -r 73c4e7d47575 -r 7a4b719ac611 hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Thu Jul 09 02:41:51 2020 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Jul 11 01:09:56 2020 +0300
@@ -7190,7 +7190,8 @@
             break;
     end;
 
-    if (offset >= -maxYStep) and (offset <= maxYStep) then
+    if (offset >= -maxYStep) and (offset <= maxYStep)
+       and (TestCollisionYImpl(x + direction, y + offset, Sentry^.Radius, -1, Sentry^.CollisionMask) = 0) then
     begin
         if not TestOnly then
         begin