diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java index 0063a0d5..22a8b662 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java @@ -216,7 +216,12 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable { return; } } else { - this.habbo.mute(Emulator.getConfig().getInt("hotel.wordfilter.automute"), false); + int muteTime = Emulator.getConfig().getInt("hotel.wordfilter.automute"); + if (muteTime > 0) { + this.habbo.mute(muteTime, false); + } else { + LOGGER.error("Invalid hotel.wordfilter.automute defined in emulator_settings ({}).", muteTime); + } } this.message = ""; diff --git a/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java b/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java index 242bdd02..af87ae9d 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java @@ -384,6 +384,11 @@ public class Habbo implements Runnable { } public void mute(int seconds, boolean isFlood) { + if (seconds <= 0) { + LOGGER.warn("Tried to mute user for {} seconds, which is invalid.", seconds); + return; + } + if (!this.hasPermission("acc_no_mute")) { int remaining = this.habboStats.addMuteTime(seconds); this.client.sendResponse(new FloodCounterComposer(remaining));