Fixed NPE with /ptp <accept|toggle|acceptall>

This commit is contained in:
TfT_02 2013-03-05 00:30:07 +01:00
parent 0c027ca697
commit 9cf322ca0b

View File

@ -32,6 +32,9 @@ public class PtpCommand implements CommandExecutor {
switch (args.length) {
case 1:
player = (Player) sender;
mcMMOPlayer = UserManager.getPlayer(player);
if (args[0].equalsIgnoreCase("toggle")) {
if (!Permissions.partyTeleportToggle(sender)) {
sender.sendMessage(command.getPermissionMessage());
@ -50,7 +53,6 @@ public class PtpCommand implements CommandExecutor {
return acceptAnyTeleportRequest();
}
player = (Player) sender;
int ptpCooldown = Config.getInstance().getPTPCommandCooldown();
long recentlyHurt = UserManager.getPlayer(player).getRecentlyHurt() * Misc.TIME_CONVERSION_FACTOR;