From eea8afdcf2418ec82ecb4249b326311d24e4a194 Mon Sep 17 00:00:00 2001 From: Deathmax Date: Thu, 2 Jun 2011 20:34:08 +0800 Subject: [PATCH] Added inventory stack check. (Not tested, but should work) --- TShockAPI/TShock.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 83a8f326..d7bc98c5 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -187,7 +187,7 @@ namespace TShockAPI if (Main.netMode != 2) { return; } int plr = who; //legacy support 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); } @@ -459,5 +459,15 @@ namespace TShockAPI } 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; + } } } \ No newline at end of file