Improve max stack hack detection. Don't check for type == 0. Mostly caused by modified save files from inventory editing that don't reset stacks.
This commit is contained in:
parent
06b487393c
commit
0ac0dd02f8
1 changed files with 4 additions and 1 deletions
|
|
@ -122,13 +122,16 @@ namespace TShockAPI
|
|||
short prefix = (short) args.Data.ReadInt8();
|
||||
int type = (int) args.Data.ReadInt16();
|
||||
|
||||
if (type == 0)
|
||||
return true;
|
||||
|
||||
var item = new Item();
|
||||
item.netDefaults(type);
|
||||
item.Prefix(prefix);
|
||||
|
||||
if (stack > item.maxStack)
|
||||
{
|
||||
return TShock.Utils.HandleCheater(args.Player, String.Format("Stack cheat detected. Remove {0} ({1}) and then rejoin", item.name, stack));
|
||||
return TShock.Utils.HandleCheater(args.Player, String.Format("Stack cheat detected. Remove {0} ({1}) > {2} and then rejoin", item.name, stack, item.maxStack));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue