540540 upText: String;
541541 hoveringTarget: Boolean;
542542 quad: TQuad;
543+ tile: TPointArray;
543544begin
544545 Self.RedClicked := False;
545546 if MainScreen.IsUpText('>') and not Self.ActionUpText.AnyContains('>') then
@@ -562,8 +563,11 @@ begin
562563 Exit;
563564
564565 quad := Self.GetQuadMS(me, pt, [0.9,0.9], Minimap.CompassRadians);
566+ tile := quad.Corners.Connect().ShapeFill();
567+ tile := tile.ExtractBox(MainScreen.Bounds);
568+ if tile = [] then Exit;
565569
566- Mouse.Move(quad );
570+ Mouse.Move(tile.RandomMean() );
567571 upText := MainScreen.UpText;
568572
569573 hoveringTarget := upText.ContainsAny(Self.TargetUpText);
@@ -621,15 +625,20 @@ You will probably never need to call this directly.
621625*)
622626function TRSWalker.IsWalkable(mapPoint, me: TPoint; out mmPoint: TPoint; radians: Double): Boolean;
623627var
624- corner: TPoint;
628+ tile: TPointArray;
629+ count: Integer;
625630begin
626631 mmPoint := Self.Point2MM(me, mapPoint, radians);
627632 if not Self.ScreenWalk then
628633 Exit(Minimap.Polygon.Expand(-1).Contains(mmPoint));
629634
630- for corner in Self.GetQuadMS(me, mapPoint, [0.9,0.9], radians).Corners do
631- if MainScreen.Bounds.Contains(corner) then
632- Exit(True);
635+ tile := Self.GetQuadMS(me, mapPoint, [0.9,0.9], radians).Corners.Connect().ShapeFill();
636+ count := Length(tile);
637+
638+ tile := tile.ExtractBox(MainScreen.Bounds);
639+ if tile = [] then Exit;
640+
641+ Result := (Length(tile) / count * 100) > 50;
633642end;
634643
635644function TRSWalker._WalkStepHelper(me, mapPoint: TPoint; randomness: Integer; out minimapPoint: TPoint; out shouldExit: Boolean): Boolean;
0 commit comments