Added inventory stack check. (Not tested, but should work)
This commit is contained in:
parent
b2d25a24a5
commit
eea8afdcf2
1 changed files with 11 additions and 1 deletions
|
|
@ -187,7 +187,7 @@ namespace TShockAPI
|
||||||
if (Main.netMode != 2) { return; }
|
if (Main.netMode != 2) { return; }
|
||||||
int plr = who; //legacy support
|
int plr = who; //legacy support
|
||||||
Tools.ShowMOTD(who);
|
Tools.ShowMOTD(who);
|
||||||
if (Main.player[plr].statLifeMax > 400 || Main.player[plr].statManaMax > 200 || Main.player[plr].statLife > 400 || Main.player[plr].statMana > 200)
|
if (Main.player[plr].statLifeMax > 400 || Main.player[plr].statManaMax > 200 || Main.player[plr].statLife > 400 || Main.player[plr].statMana > 200 || CheckInventory(plr))
|
||||||
{
|
{
|
||||||
Tools.HandleCheater(plr);
|
Tools.HandleCheater(plr);
|
||||||
}
|
}
|
||||||
|
|
@ -459,5 +459,15 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool CheckInventory(int plr)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 44; i++)
|
||||||
|
{
|
||||||
|
if (Main.player[plr].inventory[i].stack > Main.player[plr].inventory[i].maxStack)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue