Added inventory stack check. (Not tested, but should work)

This commit is contained in:
Deathmax 2011-06-02 20:34:08 +08:00
parent b2d25a24a5
commit eea8afdcf2

View file

@ -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;
}
}
}