Skip to content

Commit 0cf0125

Browse files
committed
Change drop checks in pathfinder
1 parent 1ddf726 commit 0cf0125

File tree

1 file changed

+29
-12
lines changed
  • Kepler-Server/src/main/java/org/alexdev/kepler/game/pathfinder

1 file changed

+29
-12
lines changed

Diff for: Kepler-Server/src/main/java/org/alexdev/kepler/game/pathfinder/Pathfinder.java

+29-12
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,36 @@ public static boolean isValidStep(Room room, Entity entity, Position current, Po
5959
Item fromItem = fromTile.getHighestItem();
6060
Item toItem = toTile.getHighestItem();
6161

62-
if (oldHeight - 3 >= newHeight) {
63-
return fromItem != null && (fromItem.hasBehaviour(ItemBehaviour.TELEPORTER)
64-
|| (fromItem.getDefinition().getSprite().equals("wsJoinQueue"))
65-
|| (fromItem.getDefinition().getSprite().equals("wsQueueTile"))
66-
|| (fromItem.getDefinition().getSprite().equals("poolEnter"))
67-
|| (fromItem.getDefinition().getSprite().equals("poolExit")));
68-
}
62+
boolean hasPool = room.getModel().getName().startsWith("pool_") || room.getModel().getName().equals("md_a");
63+
boolean isPrivateRoom = !room.isPublicRoom();
64+
65+
if (hasPool || isPrivateRoom) {
66+
if (hasPool) {
67+
if (oldHeight - 3 >= newHeight) {
68+
return fromItem != null && (fromItem.hasBehaviour(ItemBehaviour.TELEPORTER)
69+
|| (fromItem.getDefinition().getSprite().equals("wsJoinQueue"))
70+
|| (fromItem.getDefinition().getSprite().equals("wsQueueTile"))
71+
|| (fromItem.getDefinition().getSprite().equals("poolEnter"))
72+
|| (fromItem.getDefinition().getSprite().equals("poolExit")));
73+
}
74+
75+
}
6976

70-
if (oldHeight + 1.5 <= newHeight) {
71-
return toItem != null && (toItem.hasBehaviour(ItemBehaviour.TELEPORTER)
72-
|| (toItem.getDefinition().getSprite().equals("wsJoinQueue"))
73-
|| (toItem.getDefinition().getSprite().equals("poolEnter"))
74-
|| (toItem.getDefinition().getSprite().equals("poolExit")));
77+
if (oldHeight + 1.5 <= newHeight) {
78+
return toItem != null && (toItem.hasBehaviour(ItemBehaviour.TELEPORTER)
79+
|| (toItem.getDefinition().getSprite().equals("wsJoinQueue"))
80+
|| (toItem.getDefinition().getSprite().equals("poolEnter"))
81+
|| (toItem.getDefinition().getSprite().equals("poolExit")));
82+
}
83+
} else {
84+
// Apply this to the rest of public rooms
85+
if (oldHeight - 1.5 >= newHeight) {
86+
return false;
87+
}
88+
89+
if (oldHeight + 1.5 <= newHeight) {
90+
return false;
91+
}
7592
}
7693

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

0 commit comments

Comments
 (0)