From 572961c2fa605c35d06732f74b1553d384be6a7b Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Thu, 28 Apr 2022 23:47:05 -0300 Subject: [PATCH] Merge this if statement with the enclosing one. --- .../habbo/habbohotel/commands/SoftKickCommand.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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; } }