Skip to content

Commit 572c957

Browse files
committed
fix(Walker): read notes
The logic to check if a tile was visible or if we can click it wasn't working on resizable, this should fix it by switching from `tile := tile.ExtractBox(MainScreen.Bounds)` to ` tile := MainScreen.Filter(tile)`
1 parent 8f385c3 commit 572c957

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

osrs/interfaces/minimap.simba

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Main record used to interact with the {ref}`Minimap`.
4949

5050
Compass: record
5151
Circle: TCircle;
52-
Accuracy: Double;
52+
Accuracy: Single;
5353
end;
5454

5555
Mask: TPointArray;
@@ -300,12 +300,12 @@ begin
300300
Result := Result + TAU;
301301
end;
302302

303-
property TRSMinimap.CompassRadians(radians: Double): Boolean;
303+
property TRSMinimap.CompassRadians(radians: Single): Boolean;
304304
const
305-
RAD_PER_PIXEL: Double = 162.2004206;
305+
RAD_PER_PIXEL: Single = 162.2004206;
306306
var
307307
available: TBox;
308-
remain, oneDeg: Double;
308+
remain, oneDeg: Single;
309309
clockwise: Boolean;
310310
destination: TPoint;
311311
pixels: Integer;

osrs/walker.simba

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ begin
556556

557557
quad := Self.GetQuadMS(me, pt, [0.9,0.9], Minimap.CompassRadians);
558558
tile := quad.Corners.Connect().ShapeFill();
559-
tile := tile.ExtractBox(MainScreen.Bounds);
559+
tile := MainScreen.Filter(tile);
560560
if tile = [] then Exit;
561561

562562
Mouse.Move(tile.RandomMean());
@@ -610,12 +610,12 @@ end;
610610
(*
611611
## Walker.IsWalkable
612612
```pascal
613-
function TRSWalker.IsWalkable(mapPoint: TPoint; me: TPoint; out mmPoint: TPoint; radians: Double): Boolean;
613+
function TRSWalker.IsWalkable(mapPoint: TPoint; me: TPoint; out mmPoint: TPoint; radians: Single): Boolean;
614614
```
615615
Internal method used by walker to decide if the destination point is within 1 click reach.
616616
You will probably never need to call this directly.
617617
*)
618-
function TRSWalker.IsWalkable(mapPoint, me: TPoint; out mmPoint: TPoint; radians: Double): Boolean;
618+
function TRSWalker.IsWalkable(mapPoint, me: TPoint; out mmPoint: TPoint; radians: Single): Boolean;
619619
var
620620
tile: TPointArray;
621621
count: Integer;
@@ -627,10 +627,10 @@ begin
627627
tile := Self.GetQuadMS(me, mapPoint, [0.9,0.9], radians).Corners.Connect().ShapeFill();
628628
count := Length(tile);
629629

630-
tile := tile.ExtractBox(MainScreen.Bounds);
630+
tile := MainScreen.Filter(tile);
631631
if tile = [] then Exit;
632632

633-
Result := (Length(tile) / count * 100) > 50;
633+
Result := (Length(tile) / count * 100) > 35; //tile is 35% visible
634634
end;
635635

636636
function TRSWalker._WalkStepHelper(me, mapPoint: TPoint; randomness: Integer; out minimapPoint: TPoint; out shouldExit: Boolean): Boolean;

0 commit comments

Comments
 (0)