mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Fixed unnecessary spam of RoomUserDanceComposer packets
This commit is contained in:
parent
9b25c37525
commit
f8d0893c13
@ -4272,14 +4272,16 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void dance(RoomUnit unit, DanceType danceType) {
|
public void dance(RoomUnit unit, DanceType danceType) {
|
||||||
boolean isDancing = !unit.getDanceType().equals(DanceType.NONE);
|
if(unit.getDanceType() != danceType) {
|
||||||
unit.setDanceType(danceType);
|
boolean isDancing = !unit.getDanceType().equals(DanceType.NONE);
|
||||||
this.sendComposer(new RoomUserDanceComposer(unit).compose());
|
unit.setDanceType(danceType);
|
||||||
|
this.sendComposer(new RoomUserDanceComposer(unit).compose());
|
||||||
|
|
||||||
if (danceType.equals(DanceType.NONE) && isDancing) {
|
if (danceType.equals(DanceType.NONE) && isDancing) {
|
||||||
WiredHandler.handle(WiredTriggerType.STOPS_DANCING, unit, this, new Object[]{unit});
|
WiredHandler.handle(WiredTriggerType.STOPS_DANCING, unit, this, new Object[]{unit});
|
||||||
} else if (!danceType.equals(DanceType.NONE) && !isDancing) {
|
} else if (!danceType.equals(DanceType.NONE) && !isDancing) {
|
||||||
WiredHandler.handle(WiredTriggerType.STARTS_DANCING, unit, this, new Object[]{unit});
|
WiredHandler.handle(WiredTriggerType.STARTS_DANCING, unit, this, new Object[]{unit});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
|
|||||||
|
|
||||||
WiredHandler.handle(WiredTriggerType.WALKS_ON_FURNI, roomUnit, room, new Object[]{this});
|
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);
|
roomUnit.setDanceType(DanceType.NONE);
|
||||||
room.sendComposer(new RoomUserDanceComposer(roomUnit).compose());
|
room.sendComposer(new RoomUserDanceComposer(roomUnit).compose());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user