Teleporter Fix - Beny

This commit is contained in:
KrewsOrg 2019-12-26 16:53:10 +00:00
parent fdee1e2d3e
commit 1151a6197d

View File

@ -21,7 +21,7 @@ public class InteractionTeleport extends HabboItem {
private int targetId; private int targetId;
private int targetRoomId; private int targetRoomId;
private int roomUnitID = -1; private int roomUnitID = -1;
private boolean walkable = false; private boolean walkable;
public InteractionTeleport(ResultSet set, Item baseItem) throws SQLException { public InteractionTeleport(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem); super(set, baseItem);
@ -82,6 +82,7 @@ public class InteractionTeleport extends HabboItem {
if (this.roomUnitID == unit.getId() && unit.getCurrentLocation().equals(currentLocation)) { if (this.roomUnitID == unit.getId() && unit.getCurrentLocation().equals(currentLocation)) {
startTeleport(room, habbo); startTeleport(room, habbo);
walkable = true;
} else if (unit.getCurrentLocation().equals(currentLocation) || unit.getCurrentLocation().equals(infrontTile)) { } else if (unit.getCurrentLocation().equals(currentLocation) || unit.getCurrentLocation().equals(infrontTile)) {
// set state 1 and walk on item // set state 1 and walk on item
this.roomUnitID = unit.getId(); this.roomUnitID = unit.getId();
@ -93,11 +94,11 @@ public class InteractionTeleport extends HabboItem {
List<Runnable> onFail = new ArrayList<Runnable>(); List<Runnable> onFail = new ArrayList<Runnable>();
onSuccess.add(() -> { onSuccess.add(() -> {
walkable = this.getBaseItem().allowWalk();
room.updateTile(currentLocation); room.updateTile(currentLocation);
tryTeleport(client, room); tryTeleport(client, room);
unit.removeOverrideTile(currentLocation); unit.removeOverrideTile(currentLocation);
unit.setCanLeaveRoomByDoor(true); unit.setCanLeaveRoomByDoor(true);
walkable = this.getBaseItem().allowWalk();
}); });
onFail.add(() -> { onFail.add(() -> {
@ -208,8 +209,10 @@ public class InteractionTeleport extends HabboItem {
} }
public void startTeleport(Room room, Habbo habbo, int delay) { public void startTeleport(Room room, Habbo habbo, int delay) {
if (habbo.getRoomUnit().isTeleporting) if (habbo.getRoomUnit().isTeleporting) {
walkable = this.getBaseItem().allowWalk();
return; return;
}
this.roomUnitID = -1; this.roomUnitID = -1;
habbo.getRoomUnit().isTeleporting = true; habbo.getRoomUnit().isTeleporting = true;