mirror of
https://github.com/2006-Scape/Parabot-Randoms.git
synced 2026-07-07 16:49:11 +00:00
[FIX] FIxed NPE in Mysterious Man and Sandwich Lady Solvers
This commit is contained in:
@@ -17,7 +17,7 @@ public class MysteriousOldMan implements Random {
|
|||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
for (Npc npc : Npcs.getNearest(410)) {
|
for (Npc npc : Npcs.getNearest(410)) {
|
||||||
if (npc != null && npc.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
if (npc != null && npc.getDef() != null && npc.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||||
man = npc;
|
man = npc;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public class MysteriousOldMan implements Random {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (man != null && man.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
if (man != null && man.getDef() != null && man.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||||
man.interact(0);
|
man.interact(0);
|
||||||
Time.sleep(new SleepCondition() {
|
Time.sleep(new SleepCondition() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class SandwichLady implements Random {
|
|||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
for (Npc npc : Npcs.getNearest(3117)) {
|
for (Npc npc : Npcs.getNearest(3117)) {
|
||||||
if (npc != null && npc.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
if (npc != null && npc.getDef() != null && npc.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||||
lady = npc;
|
lady = npc;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ public class SandwichLady implements Random {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
if (lady != null && lady.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
if (lady != null && lady.getDef() != null && lady.getInteractingCharacter().equals(Players.getMyPlayer())) {
|
||||||
lady.interact(0);
|
lady.interact(0);
|
||||||
Time.sleep(new SleepCondition() {
|
Time.sleep(new SleepCondition() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user