Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Commit

Permalink
Change drop checks in pathfinder
Browse files Browse the repository at this point in the history
  • Loading branch information
Quackster committed Mar 16, 2020
1 parent 1ddf726 commit 0cf0125
Showing 1 changed file with 29 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,36 @@ public static boolean isValidStep(Room room, Entity entity, Position current, Po
Item fromItem = fromTile.getHighestItem();
Item toItem = toTile.getHighestItem();

if (oldHeight - 3 >= newHeight) {
return fromItem != null && (fromItem.hasBehaviour(ItemBehaviour.TELEPORTER)
|| (fromItem.getDefinition().getSprite().equals("wsJoinQueue"))
|| (fromItem.getDefinition().getSprite().equals("wsQueueTile"))
|| (fromItem.getDefinition().getSprite().equals("poolEnter"))
|| (fromItem.getDefinition().getSprite().equals("poolExit")));
}
boolean hasPool = room.getModel().getName().startsWith("pool_") || room.getModel().getName().equals("md_a");
boolean isPrivateRoom = !room.isPublicRoom();

if (hasPool || isPrivateRoom) {
if (hasPool) {
if (oldHeight - 3 >= newHeight) {
return fromItem != null && (fromItem.hasBehaviour(ItemBehaviour.TELEPORTER)
|| (fromItem.getDefinition().getSprite().equals("wsJoinQueue"))
|| (fromItem.getDefinition().getSprite().equals("wsQueueTile"))
|| (fromItem.getDefinition().getSprite().equals("poolEnter"))
|| (fromItem.getDefinition().getSprite().equals("poolExit")));
}

}

if (oldHeight + 1.5 <= newHeight) {
return toItem != null && (toItem.hasBehaviour(ItemBehaviour.TELEPORTER)
|| (toItem.getDefinition().getSprite().equals("wsJoinQueue"))
|| (toItem.getDefinition().getSprite().equals("poolEnter"))
|| (toItem.getDefinition().getSprite().equals("poolExit")));
if (oldHeight + 1.5 <= newHeight) {
return toItem != null && (toItem.hasBehaviour(ItemBehaviour.TELEPORTER)
|| (toItem.getDefinition().getSprite().equals("wsJoinQueue"))
|| (toItem.getDefinition().getSprite().equals("poolEnter"))
|| (toItem.getDefinition().getSprite().equals("poolExit")));
}
} else {
// Apply this to the rest of public rooms
if (oldHeight - 1.5 >= newHeight) {
return false;
}

if (oldHeight + 1.5 <= newHeight) {
return false;
}
}

// Only check these below if the user is in a pool room.
Expand Down

0 comments on commit 0cf0125

Please sign in to comment.