Fixed unnecessary spam of RoomUserDanceComposer packets

This commit is contained in:
Beny 2020-10-15 04:56:48 +02:00
parent 9b25c37525
commit f8d0893c13
2 changed files with 10 additions and 8 deletions

View File

@ -4272,6 +4272,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
public void dance(RoomUnit unit, DanceType danceType) {
if(unit.getDanceType() != danceType) {
boolean isDancing = !unit.getDanceType().equals(DanceType.NONE);
unit.setDanceType(danceType);
this.sendComposer(new RoomUserDanceComposer(unit).compose());
@ -4282,6 +4283,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
WiredHandler.handle(WiredTriggerType.STARTS_DANCING, unit, this, new Object[]{unit});
}
}
}
public void addToWordFilter(String word) {
synchronized (this.wordFilterWords) {

View File

@ -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());
}