Fix /npc select with only 1 argument

This commit is contained in:
fullwall 2012-10-12 14:25:56 +08:00
parent f8ccd0b4fd
commit 7aa56a5ffb

View File

@ -624,7 +624,7 @@ public class NPCCommands {
@Requirements(ownership = true) @Requirements(ownership = true)
public void select(CommandContext args, CommandSender sender, NPC npc) throws CommandException { public void select(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
NPC toSelect = null; NPC toSelect = null;
if (args.argsLength() == 0) { if (args.argsLength() <= 1) {
if (!(sender instanceof Player)) if (!(sender instanceof Player))
throw new ServerCommandException(); throw new ServerCommandException();
double range = Math.abs(args.getFlagDouble("r", 10)); double range = Math.abs(args.getFlagDouble("r", 10));