Make looping commands see vanished players properly

Make /r check player existence in the correct order
This commit is contained in:
Chris Ward 2013-10-19 19:06:42 +11:00 committed by KHobbits
parent e25e02d154
commit 97d176ea27
2 changed files with 3 additions and 2 deletions

View File

@ -44,13 +44,14 @@ public class Commandr extends EssentialsCommand
}
final CommandSource target = replyTo.getReplyTo();
final String targetName = target.isPlayer() ? target.getPlayer().getDisplayName() : Console.NAME;
if (target == null || (target.isPlayer() && !target.getPlayer().isOnline()))
{
throw new Exception(_("foreverAlone"));
}
final String targetName = target.isPlayer() ? target.getPlayer().getDisplayName() : Console.NAME;
sender.sendMessage(_("msgFormat", _("me"), targetName, message));
if (target.isPlayer())
{

View File

@ -116,7 +116,7 @@ public abstract class EssentialsLoopCommand extends EssentialsCommand
}
else
{
final User player = getPlayer(server, searchTerm, skipHidden, false);
final User player = getPlayer(server, searchTerm, !skipHidden, false);
updatePlayer(server, sender, player, commandArgs);
}
}