From cef253ce2039cdf4f4d3d248b14b711cd7d523cf Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Wed, 8 Apr 2015 23:46:00 -0600 Subject: [PATCH] Remove the ability to ban oneself --- TShockAPI/Commands.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 2b277185..6ef9d615 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1211,6 +1211,13 @@ namespace TShockAPI if (user != null) { bool force = !args.Player.RealPlayer; + + if (user.Name == args.Player.Name && !force) + { + args.Player.SendErrorMessage("You can't ban yourself!"); + return; + } + if (TShock.Groups.GetGroupByName(user.Group).HasPermission(Permissions.immunetoban) && !force) args.Player.SendErrorMessage("You can't ban {0}!", user.Name); else