diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java b/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java index 513ce9bd..b4cd0433 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java @@ -125,7 +125,7 @@ public class WordFilter { public String filter(String message, Habbo habbo) { String filteredMessage = message; - if (!Emulator.getConfig().getBoolean("hotel.wordfilter.enabled", true) || habbo.hasPermission(Permission.ACC_CHAT_NO_FILTER)) { + if (!Emulator.getConfig().getBoolean("hotel.wordfilter.enabled", true) || (habbo != null && habbo.hasPermission(Permission.ACC_CHAT_NO_FILTER))) { return message; } if (Emulator.getConfig().getBoolean("hotel.wordfilter.normalise")) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/CommandBotEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/CommandBotEvent.java index e645c105..0c8bb4d7 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/CommandBotEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/CommandBotEvent.java @@ -71,7 +71,7 @@ public class CommandBotEvent extends MessageHandler { count++; } - String result = Emulator.getGameEnvironment().getWordFilter().filter(s, null); + String result = Emulator.getGameEnvironment().getWordFilter().filter(s, this.client.getHabbo()); if (!result.isEmpty()) { if (!this.client.getHabbo().hasPermission(Permission.ACC_CHAT_NO_FILTER)) { @@ -117,7 +117,7 @@ public class CommandBotEvent extends MessageHandler { String name = this.packet.readString(); boolean invalidName = name.length() > BotManager.MAXIMUM_NAME_LENGTH || name.contains("<") || name.contains(">"); if (!invalidName) { - String filteredName = Emulator.getGameEnvironment().getWordFilter().filter(name, null); + String filteredName = Emulator.getGameEnvironment().getWordFilter().filter(name, this.client.getHabbo()); invalidName = !name.equalsIgnoreCase(filteredName); if (!invalidName) { BotSavedNameEvent nameEvent = new BotSavedNameEvent(bot, name);