Skip to content

Commit cdc160d

Browse files
committed
fix(objects/entities): Now filters the TPA that will hover
1 parent 7f0d1dd commit cdc160d

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

osrs/position/map/entities.simba

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,10 @@ begin
553553
else if Length(atpa) > (attempt - 2) then i := attempt - 2
554554
else i := Random(Low(atpa), High(atpa));
555555

556-
tpa := atpa[i];
556+
tpa := atpa[i].ExtractBox(MainScreen.Bounds);
557+
if tpa = [] then
558+
Continue;
559+
557560
Self.LastCoordinate := coordinates[i];
558561

559562
Mouse.Move(tpa.RandomMean());
@@ -635,7 +638,10 @@ begin
635638
else if Length(atpa) > (attempt - 2) then i := attempt - 2
636639
else i := Random(Low(atpa), High(atpa));
637640

638-
tpa := atpa[i];
641+
tpa := atpa[i].ExtractBox(MainScreen.Bounds);
642+
if tpa = [] then
643+
Continue;
644+
639645
Self.LastCoordinate := coordinates[i];
640646

641647
Mouse.Move(tpa.RandomMean());

osrs/position/map/objects.simba

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,10 @@ begin
755755
else if Length(atpa) > (attempt - 2) then i := attempt - 2
756756
else i := Random(Low(atpa), High(atpa));
757757

758-
tpa := atpa[i];
758+
tpa := atpa[i].ExtractBox(MainScreen.Bounds);
759+
if tpa = [] then
760+
Continue;
761+
759762
Self.LastCoordinate := coordinates[i];
760763

761764
Mouse.Move(tpa.RandomMean());
@@ -858,7 +861,10 @@ begin
858861
else if Length(atpa) > (attempt - 2) then i := attempt - 2
859862
else i := Random(Low(atpa), High(atpa));
860863

861-
tpa := atpa[i];
864+
tpa := atpa[i].ExtractBox(MainScreen.Bounds);
865+
if tpa = [] then
866+
Continue;
867+
862868
Self.LastCoordinate := coordinates[i];
863869

864870
Mouse.Move(tpa.RandomMean());

0 commit comments

Comments
 (0)