Add some missing hidden checks

This commit is contained in:
KHobbits 2013-03-19 23:24:06 +00:00
parent 8f6c61fa99
commit 896e14670f
7 changed files with 48 additions and 31 deletions

View file

@ -22,7 +22,7 @@ public class Commandpay extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
//TODO: TL this.
if (args[0].trim().length() < 2)
{
@ -30,19 +30,19 @@ public class Commandpay extends EssentialsCommand
}
double amount = Double.parseDouble(args[1].replaceAll("[^0-9\\.]", ""));
boolean foundUser = false;
final List<Player> matchedPlayers = server.matchPlayer(args[0]);
final List<Player> matchedPlayers = server.matchPlayer(args[0]);
for (Player matchPlayer : matchedPlayers)
{
User u = ess.getUser(matchPlayer);
if (u.isHidden())
User player = ess.getUser(matchPlayer);
if (player.isHidden())
{
continue;
}
foundUser = true;
user.payUser(u, amount);
Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), u.getName(), new Trade(amount, ess), user.getLocation(), ess);
user.payUser(player, amount);
Trade.log("Command", "Pay", "Player", user.getName(), new Trade(amount, ess), player.getName(), new Trade(amount, ess), user.getLocation(), ess);
}
if (!foundUser)