From e9ae737c90f04b466f7e1298fee24e0bf065dcef Mon Sep 17 00:00:00 2001 From: Harmonic Date: Wed, 16 Nov 2022 16:05:09 +0000 Subject: [PATCH] Revert changes to teams --- .../com/eu/habbo/habbohotel/rooms/Room.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) 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 c408c069..119df291 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -4124,23 +4124,15 @@ public class Room implements Comparable, ISerialize, Runnable { } public void giveEffect(RoomUnit roomUnit, int effectId, int duration) { - if(roomUnit == null) return; + if (duration == -1 || duration == Integer.MAX_VALUE) { + duration = Integer.MAX_VALUE; + } else { + duration += Emulator.getIntUnixTimestamp(); + } - Habbo habbo = roomUnit.getRoom().getHabbo(roomUnit); - - if(habbo == null) return; - - if (!habbo.getHabboInfo().isInGame()) { - if (duration == -1 || duration == Integer.MAX_VALUE) { - duration = Integer.MAX_VALUE; - } else { - duration += Emulator.getIntUnixTimestamp(); - } - - if (this.allowEffects) { - roomUnit.setEffectId(effectId, duration); - this.sendComposer(new RoomUserEffectComposer(roomUnit).compose()); - } + if (this.allowEffects && roomUnit != null) { + roomUnit.setEffectId(effectId, duration); + this.sendComposer(new RoomUserEffectComposer(roomUnit).compose()); } }