소스 검색

Fixed exploit where you could teleport to yourself...

GJ 13 년 전
부모
커밋
e3803702c5
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java

+ 5 - 1
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;
         }
    }
-}
+}