Fix bypassing SSC using items in hand (trashcans are still exploitable until Redigit or his merry men decide that its a bug and fix it)

This commit is contained in:
Zack Piispanen 2014-01-19 18:45:45 -05:00
parent 6b7e6523d1
commit 4ef324e026
3 changed files with 13 additions and 0 deletions

View file

@ -1310,6 +1310,12 @@ namespace TShockAPI
args.Player.IgnoreActionsForClearingTrashCan = true;
}
if (slot == 58) //this is the hand
{
item.stack = stack;
args.Player.ItemInHand = item;
}
return false;
}

View file

@ -809,6 +809,7 @@ namespace TShockAPI
private DateTime LastDisableNotification = DateTime.UtcNow;
public int ActiveChest = -1;
public Item ItemInHand = new Item();
public virtual void Disable(string reason = "", bool displayConsole = true)
{

View file

@ -393,6 +393,12 @@ namespace TShockAPI
{
if (args.Player.IsLoggedIn)
args.Player.SaveServerCharacter();
if (args.Player.ItemInHand.type != 0)
{
args.Player.SendErrorMessage("Attempting to bypass SSC with item in hand.");
args.Handled = true;
}
}
private void NetHooks_NameCollision(NameCollisionEventArgs args)