Added check for over-stacked items creating a negative amount for items over max stack count.
Added message output to player for why they are disabled when having an over-stacked item. Added message output to player for why they are disabled when having a banned item equipped.
This commit is contained in:
parent
ffa68c1115
commit
15db899b57
1 changed files with 5 additions and 1 deletions
|
|
@ -807,10 +807,12 @@ namespace TShockAPI
|
||||||
string check = "none";
|
string check = "none";
|
||||||
foreach (Item item in player.TPlayer.inventory)
|
foreach (Item item in player.TPlayer.inventory)
|
||||||
{
|
{
|
||||||
if (!player.Group.HasPermission(Permissions.ignorestackhackdetection) && item.stack > item.maxStack &&
|
if (!player.Group.HasPermission(Permissions.ignorestackhackdetection) && (item.stack > item.maxStack || item.stack < 0) &&
|
||||||
item.type != 0)
|
item.type != 0)
|
||||||
{
|
{
|
||||||
check = "Remove item " + item.name + " (" + item.stack + ") exceeds max stack of " + item.maxStack;
|
check = "Remove item " + item.name + " (" + item.stack + ") exceeds max stack of " + item.maxStack;
|
||||||
|
player.SendErrorMessage(check);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.IgnoreActionsForCheating = check;
|
player.IgnoreActionsForCheating = check;
|
||||||
|
|
@ -822,6 +824,8 @@ namespace TShockAPI
|
||||||
player.SetBuff(30, 120); //Bleeding
|
player.SetBuff(30, 120); //Bleeding
|
||||||
player.SetBuff(36, 120); //Broken Armor
|
player.SetBuff(36, 120); //Broken Armor
|
||||||
check = "Remove armor/accessory " + item.name;
|
check = "Remove armor/accessory " + item.name;
|
||||||
|
|
||||||
|
player.SendErrorMessage(string.Format("You are wearing banned equipment. {0}", check));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.IgnoreActionsForDisabledArmor = check;
|
player.IgnoreActionsForDisabledArmor = check;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue