diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/SoftKickCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/SoftKickCommand.java index b841b945..5b0fddcd 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/SoftKickCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/SoftKickCommand.java @@ -14,12 +14,11 @@ public class SoftKickCommand extends Command { @Override public boolean handle(GameClient gameClient, String[] params) throws Exception { - if (params.length == 2) { - final String username = params[1]; - final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(username); + if (params.length != 2) return true; + final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(params[1]); if (habbo == null) { - gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error").replace("%user%", username), RoomChatMessageBubbles.ALERT); + gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT); return true; } @@ -30,12 +29,9 @@ public class SoftKickCommand extends Command { final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom(); - if (room != null) { - if (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) { + if (room != null && (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo)))) { room.kickHabbo(habbo, false); } - } - } - return true; + return true; } }