Revert changes to teams

This commit is contained in:
Harmonic 2022-11-16 16:05:09 +00:00
parent 353a01f563
commit e9ae737c90

View File

@ -4124,25 +4124,17 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
} }
public void giveEffect(RoomUnit roomUnit, int effectId, int duration) { public void giveEffect(RoomUnit roomUnit, int effectId, int duration) {
if(roomUnit == null) return;
Habbo habbo = roomUnit.getRoom().getHabbo(roomUnit);
if(habbo == null) return;
if (!habbo.getHabboInfo().isInGame()) {
if (duration == -1 || duration == Integer.MAX_VALUE) { if (duration == -1 || duration == Integer.MAX_VALUE) {
duration = Integer.MAX_VALUE; duration = Integer.MAX_VALUE;
} else { } else {
duration += Emulator.getIntUnixTimestamp(); duration += Emulator.getIntUnixTimestamp();
} }
if (this.allowEffects) { if (this.allowEffects && roomUnit != null) {
roomUnit.setEffectId(effectId, duration); roomUnit.setEffectId(effectId, duration);
this.sendComposer(new RoomUserEffectComposer(roomUnit).compose()); this.sendComposer(new RoomUserEffectComposer(roomUnit).compose());
} }
} }
}
public void giveHandItem(Habbo habbo, int handItem) { public void giveHandItem(Habbo habbo, int handItem) {
this.giveHandItem(habbo.getRoomUnit(), handItem); this.giveHandItem(habbo.getRoomUnit(), handItem);