From 3aead5f30fa8deed97ff0ab259c928b504d34f3b Mon Sep 17 00:00:00 2001 From: Beny Date: Sun, 26 May 2019 21:05:24 +0100 Subject: [PATCH] Added unidle when clicked to walk to any spot --- .../incoming/rooms/users/RoomUserWalkEvent.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserWalkEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserWalkEvent.java index 0d798aaf..a31b9b15 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserWalkEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserWalkEvent.java @@ -8,6 +8,7 @@ import com.eu.habbo.habbohotel.rooms.RoomUnitStatus; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.rooms.users.RoomUnitOnRollerComposer; +import com.eu.habbo.plugin.events.users.UserIdleEvent; public class RoomUserWalkEvent extends MessageHandler { @Override @@ -49,6 +50,18 @@ public class RoomUserWalkEvent extends MessageHandler { if (habbo.getHabboInfo().getCurrentRoom() == null || habbo.getHabboInfo().getCurrentRoom().getLayout() == null) return; + if (roomUnit.isIdle()) { + UserIdleEvent event = new UserIdleEvent(habbo, UserIdleEvent.IdleReason.WALKED, false); + Emulator.getPluginManager().fireEvent(event); + + if (!event.isCancelled()) { + if (!event.idle) { + roomUnit.getRoom().unIdle(habbo); + roomUnit.resetIdleTimer(); + } + } + } + RoomTile tile = habbo.getHabboInfo().getCurrentRoom().getLayout().getTile((short) x, (short) y); if (tile == null) {