Merge pull request #920 from Enerdy/general-devel
Specify which item is causing a player to be disabled. Fixes #909.
This commit is contained in:
commit
da36fb42f7
2 changed files with 69 additions and 70 deletions
|
|
@ -2294,12 +2294,12 @@ namespace TShockAPI
|
||||||
|
|
||||||
if (control[5])
|
if (control[5])
|
||||||
{
|
{
|
||||||
if (TShock.Itembans.ItemIsBanned(args.TPlayer.inventory[item].name, args.Player))
|
string itemName = args.TPlayer.inventory[item].name;
|
||||||
|
if (TShock.Itembans.ItemIsBanned(itemName, args.Player))
|
||||||
{
|
{
|
||||||
control[5] = false;
|
control[5] = false;
|
||||||
args.Player.Disable("Using banned item");
|
args.Player.Disable("using a banned item ({0})".SFormat(itemName));
|
||||||
args.Player.SendErrorMessage("You cannot use {0} on this server. Your actions are being ignored.",
|
args.Player.SendErrorMessage("You cannot use {0} on this server. Your actions are being ignored.", itemName);
|
||||||
args.TPlayer.inventory[item].name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.TPlayer.inventory[item].name == "Mana Crystal" && args.Player.TPlayer.statManaMax <= 180)
|
if (args.TPlayer.inventory[item].name == "Mana Crystal" && args.Player.TPlayer.statManaMax <= 180)
|
||||||
|
|
@ -2606,7 +2606,7 @@ namespace TShockAPI
|
||||||
if (TShock.Config.BanOnHardcoreDeath)
|
if (TShock.Config.BanOnHardcoreDeath)
|
||||||
{
|
{
|
||||||
if (!TShock.Utils.Ban(args.Player, TShock.Config.HardcoreBanReason, false, "hardcore-death"))
|
if (!TShock.Utils.Ban(args.Player, TShock.Config.HardcoreBanReason, false, "hardcore-death"))
|
||||||
TShock.Utils.ForceKick(args.Player, "Death results in a ban, but can't ban you.", true);
|
TShock.Utils.ForceKick(args.Player, "Death results in a ban, but you are immune to bans.", true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2801,7 +2801,7 @@ namespace TShockAPI
|
||||||
if (TShock.Config.BanOnMediumcoreDeath)
|
if (TShock.Config.BanOnMediumcoreDeath)
|
||||||
{
|
{
|
||||||
if (!TShock.Utils.Ban(args.Player, TShock.Config.MediumcoreBanReason, false, "mediumcore-death"))
|
if (!TShock.Utils.Ban(args.Player, TShock.Config.MediumcoreBanReason, false, "mediumcore-death"))
|
||||||
TShock.Utils.ForceKick(args.Player, "Death results in a ban, but can't ban you.", true);
|
TShock.Utils.ForceKick(args.Player, "Death results in a ban, but you are immune to bans.", true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -3232,8 +3232,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TShock.Config.RangeChecks &&
|
if (TShock.Config.RangeChecks &&
|
||||||
TShock.CheckRangePermission(args.Player, (int) (Main.npc[id].position.X/16f), (int) (Main.npc[id].position.Y/16f),
|
TShock.CheckRangePermission(args.Player, (int)(Main.npc[id].position.X / 16f), (int)(Main.npc[id].position.Y / 16f), 128))
|
||||||
128))
|
|
||||||
{
|
{
|
||||||
args.Player.SendData(PacketTypes.NpcUpdate, "", id);
|
args.Player.SendData(PacketTypes.NpcUpdate, "", id);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -871,7 +871,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
player.IgnoreActionsForCheating = check;
|
player.IgnoreActionsForCheating = check;
|
||||||
check = "none";
|
check = "none";
|
||||||
//todo: pretty sure we check every place a players inventory can change, so do we really need to do this?
|
// Please don't remove this for the time being; without it, players wearing banned equipment will only get debuffed once
|
||||||
foreach (Item item in player.TPlayer.armor)
|
foreach (Item item in player.TPlayer.armor)
|
||||||
{
|
{
|
||||||
if (Itembans.ItemIsBanned(item.name, player))
|
if (Itembans.ItemIsBanned(item.name, player))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue