From e3803702c5950f93752c47ef6b78cc6de51d7008 Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 27 Apr 2012 02:21:25 -0400 Subject: [PATCH] Fixed exploit where you could teleport to yourself... --- .../java/com/gmail/nossr50/commands/party/PtpCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java index daf493b3b..3228f4a76 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java @@ -51,6 +51,10 @@ public class PtpCommand implements CommandExecutor { Player target = plugin.getServer().getPlayer(args[0]); + if (player.equals(target)) { + player.sendMessage("You can't teleport to yourself!"); //TODO: Use locale + } + if (target == null) { player.sendMessage(mcLocale.getString("Party.Teleport.Invalid")); return true; @@ -85,4 +89,4 @@ public class PtpCommand implements CommandExecutor { return true; } } -} \ No newline at end of file +}