This commit is contained in:
AlfreviD 2022-04-10 16:07:50 +00:00
parent f73cab18bb
commit b1ea3dfd66

View File

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