iutils: fix diagonal door npe

walking: fix burning amulet id
This commit is contained in:
illumineawake 2021-08-08 22:15:45 +10:00
parent 38c2401f0b
commit 1919e9bdab
7 changed files with 10 additions and 11 deletions

View File

@ -23,7 +23,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
version = "4.3.4"
version = "4.3.5"
project.extra["PluginName"] = "iUtils"
project.extra["PluginDescription"] = "Illumine - Utils required for plugins to function with added automation"

View File

@ -451,10 +451,8 @@ public class Game {
if (condition.getAsBoolean()) {
return true;
}
tick();
}
return false;
}

View File

@ -78,7 +78,7 @@ public class Position implements Area {
return ((Position) other).distanceTo(this);
}
return -1;
return Integer.MAX_VALUE;
}
public boolean inside(Area area) {

View File

@ -20,7 +20,7 @@ public class TeleportLoader {
public static final int[] RING_OF_WEALTH = {11980, 11982, 11984, 11986, 11988};
public static final int[] AMULET_OF_GLORY = {1712, 1706, 1708, 1710, 11976, 11978};
public static final int[] NECKLACE_OF_PASSAGE = {21146, 21149, 21151, 21153, 21155};
public static final int[] BURNING_AMULET = {21166, 21171, 21173, 21175, 21167};
public static final int[] BURNING_AMULET = {21166, 21171, 21173, 21175, 21167, 21169};
public static final int XERICS_TALISMAN = 13393;
public static final int[] SLAYER_RING = {11866, 11867, 11868, 11869, 11870, 11871, 11872, 11873, 21268};
public static final int[] DIGSITE_PENDANT = {11190, 11191, 11192, 11193, 11194};

View File

@ -90,11 +90,11 @@ public class Walking {
var playerPosition = game.localPlayer().position();
for (var teleport : new TeleportLoader(game).buildTeleports()) {
if (teleport.target.distanceTo(playerPosition) > 50 && (playerPosition.distanceTo(target) > teleport.target.distanceTo(target) + 20)) {
// if (teleport.target.distanceTo(playerPosition) > 50 && (playerPosition.distanceTo(target) > teleport.target.distanceTo(target) + 20)) {
teleports.putIfAbsent(teleport.target, teleport);
} else {
log.info("Teleport not added due to distance reqs: {}", teleport.target);
}
// } else {
// log.info("Teleport not added due to distance reqs: {}", teleport.target);
// }
}
var starts = new ArrayList<>(teleports.keySet());
@ -222,7 +222,8 @@ public class Walking {
private boolean hasDiagonalDoor(iTile tile) {
var wall = tile.object(ObjectCategory.REGULAR);
return wall != null && wall.actions().contains("Open");
return wall != null && !wall.position().equals(game.localPlayer().position()) && wall.actions().contains("Open");
}
private boolean isWallBlocking(Position a, Position b) {

File diff suppressed because one or more lines are too long