mirror of
https://github.com/PikaMug/Quests.git
synced 2024-09-29 15:37:27 +02:00
Check for player on compass update, fixes #1897
This commit is contained in:
parent
08ae5b4f76
commit
5befbb1e8c
@ -459,6 +459,9 @@ public class Quest implements IQuest {
|
|||||||
.getItemDeliveryTargets().getFirst());
|
.getItemDeliveryTargets().getFirst());
|
||||||
targetLocation = npc.getStoredLocation();
|
targetLocation = npc.getStoredLocation();
|
||||||
} else if (stage.getPlayersToKill() != null && stage.getPlayersToKill() > 0) {
|
} else if (stage.getPlayersToKill() != null && stage.getPlayersToKill() > 0) {
|
||||||
|
if (quester.getPlayer() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final Location source = quester.getPlayer().getLocation();
|
final Location source = quester.getPlayer().getLocation();
|
||||||
Location nearest = null;
|
Location nearest = null;
|
||||||
double old_distance = 30000000;
|
double old_distance = 30000000;
|
||||||
@ -479,6 +482,9 @@ public class Quest implements IQuest {
|
|||||||
targetLocation = nearest;
|
targetLocation = nearest;
|
||||||
}
|
}
|
||||||
} else if (stage.getMobsToKill() != null && stage.getMobsToKill().size() > 0) {
|
} else if (stage.getMobsToKill() != null && stage.getMobsToKill().size() > 0) {
|
||||||
|
if (quester.getPlayer() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final Location source = quester.getPlayer().getLocation();
|
final Location source = quester.getPlayer().getLocation();
|
||||||
Location nearest = null;
|
Location nearest = null;
|
||||||
double old_distance = 30000000;
|
double old_distance = 30000000;
|
||||||
@ -500,6 +506,9 @@ public class Quest implements IQuest {
|
|||||||
targetLocation = nearest;
|
targetLocation = nearest;
|
||||||
}
|
}
|
||||||
} else if (stage.getMobsToTame() != null && stage.getMobsToTame().size() > 0) {
|
} else if (stage.getMobsToTame() != null && stage.getMobsToTame().size() > 0) {
|
||||||
|
if (quester.getPlayer() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final Location source = quester.getPlayer().getLocation();
|
final Location source = quester.getPlayer().getLocation();
|
||||||
Location nearest = null;
|
Location nearest = null;
|
||||||
double old_distance = 30000000;
|
double old_distance = 30000000;
|
||||||
@ -521,6 +530,9 @@ public class Quest implements IQuest {
|
|||||||
targetLocation = nearest;
|
targetLocation = nearest;
|
||||||
}
|
}
|
||||||
} else if (stage.getSheepToShear() != null && stage.getSheepToShear().size() > 0) {
|
} else if (stage.getSheepToShear() != null && stage.getSheepToShear().size() > 0) {
|
||||||
|
if (quester.getPlayer() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final Location source = quester.getPlayer().getLocation();
|
final Location source = quester.getPlayer().getLocation();
|
||||||
Location nearest = null;
|
Location nearest = null;
|
||||||
double old_distance = 30000000;
|
double old_distance = 30000000;
|
||||||
@ -547,6 +559,9 @@ public class Quest implements IQuest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (targetLocation != null && targetLocation.getWorld() != null) {
|
if (targetLocation != null && targetLocation.getWorld() != null) {
|
||||||
|
if (quester.getPlayer() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (targetLocation.getWorld().getName().equals(quester.getPlayer().getWorld().getName())) {
|
if (targetLocation.getWorld().getName().equals(quester.getPlayer().getWorld().getName())) {
|
||||||
final Location lockedTarget = new Location(targetLocation.getWorld(), targetLocation.getX(),
|
final Location lockedTarget = new Location(targetLocation.getWorld(), targetLocation.getX(),
|
||||||
targetLocation.getY(), targetLocation.getZ());
|
targetLocation.getY(), targetLocation.getZ());
|
||||||
|
Loading…
Reference in New Issue
Block a user