Avoid null locations on reload, untested, fixes #102

This commit is contained in:
HappyPikachu 2017-08-13 23:58:37 -04:00
parent 0f52951a6c
commit f3792b480c

View File

@ -164,10 +164,11 @@ public class Quest {
} else if (nextStage.locationsToReach != null && nextStage.locationsToReach.size() > 0) {
targetLocation = nextStage.locationsToReach.getFirst();
}
if (targetLocation != null && targetLocation.getWorld().equals(quester.getPlayer().getWorld())) {
// plugin.getLogger().info("Setting compass target for " + quester.getPlayer().getName() + " to " + targetLocation);
if (targetLocation != null) {
if (targetLocation.getWorld().equals(quester.getPlayer().getWorld())) {
quester.getPlayer().setCompassTarget(targetLocation);
}
}
return targetLocation != null;
}