Merge branch 'dev' into 'dev'

Fix Issue #948

See merge request morningstar/Arcturus-Community!529
This commit is contained in:
Harmonic 2022-04-10 16:32:07 +00:00
commit ff34d89688

View File

@ -4124,15 +4124,23 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
}
public void giveEffect(RoomUnit roomUnit, int effectId, int duration) {
if (duration == -1 || duration == Integer.MAX_VALUE) {
duration = Integer.MAX_VALUE;
} else {
duration += Emulator.getIntUnixTimestamp();
}
if(roomUnit == null) return;
if (this.allowEffects && roomUnit != null) {
roomUnit.setEffectId(effectId, duration);
this.sendComposer(new RoomUserEffectComposer(roomUnit).compose());
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());
}
}
}