Fix "No player found" message in CmdKick

When `/f kick` was used with zero arguments, an ugly message was sent to
the player regarding a missing player match for "null"
This commit is contained in:
mrlolethan 2015-01-07 18:29:42 -03:30 committed by eueln
parent 8103f953eb
commit dc3e7e953b

View File

@ -32,7 +32,7 @@ public class CmdKick extends FCommand {
@Override
public void perform() {
FPlayer toKick = this.argAsBestFPlayerMatch(0);
FPlayer toKick = this.argIsSet(0) ? this.argAsBestFPlayerMatch(0) : null;
if (toKick == null) {
FancyMessage msg = new FancyMessage(TL.COMMAND_KICK_CANDIDATES.toString()).color(ChatColor.GOLD);
for (FPlayer player : myFaction.getFPlayersWhereRole(Role.NORMAL)) {