diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 65fffba4..d5622108 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -4272,14 +4272,16 @@ public class Room implements Comparable, ISerialize, Runnable { } public void dance(RoomUnit unit, DanceType danceType) { - boolean isDancing = !unit.getDanceType().equals(DanceType.NONE); - unit.setDanceType(danceType); - this.sendComposer(new RoomUserDanceComposer(unit).compose()); + if(unit.getDanceType() != danceType) { + boolean isDancing = !unit.getDanceType().equals(DanceType.NONE); + unit.setDanceType(danceType); + this.sendComposer(new RoomUserDanceComposer(unit).compose()); - if (danceType.equals(DanceType.NONE) && isDancing) { - WiredHandler.handle(WiredTriggerType.STOPS_DANCING, unit, this, new Object[]{unit}); - } else if (!danceType.equals(DanceType.NONE) && !isDancing) { - WiredHandler.handle(WiredTriggerType.STARTS_DANCING, unit, this, new Object[]{unit}); + if (danceType.equals(DanceType.NONE) && isDancing) { + WiredHandler.handle(WiredTriggerType.STOPS_DANCING, unit, this, new Object[]{unit}); + } else if (!danceType.equals(DanceType.NONE) && !isDancing) { + WiredHandler.handle(WiredTriggerType.STARTS_DANCING, unit, this, new Object[]{unit}); + } } } diff --git a/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java b/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java index 37939548..563e5276 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java @@ -308,7 +308,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers { WiredHandler.handle(WiredTriggerType.WALKS_ON_FURNI, roomUnit, room, new Object[]{this}); - if ((this.getBaseItem().allowSit() || this.getBaseItem().allowLay()) && roomUnit.getDanceType() != DanceType.NONE) { + if ((this.getBaseItem().allowSit() || this.getBaseItem().allowLay()) && !roomUnit.getDanceType().equals(DanceType.NONE)) { roomUnit.setDanceType(DanceType.NONE); room.sendComposer(new RoomUserDanceComposer(roomUnit).compose()); }