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:
parent
6b7e6523d1
commit
4ef324e026
3 changed files with 13 additions and 0 deletions
|
|
@ -1310,6 +1310,12 @@ namespace TShockAPI
|
||||||
args.Player.IgnoreActionsForClearingTrashCan = true;
|
args.Player.IgnoreActionsForClearingTrashCan = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (slot == 58) //this is the hand
|
||||||
|
{
|
||||||
|
item.stack = stack;
|
||||||
|
args.Player.ItemInHand = item;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -809,6 +809,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
private DateTime LastDisableNotification = DateTime.UtcNow;
|
private DateTime LastDisableNotification = DateTime.UtcNow;
|
||||||
public int ActiveChest = -1;
|
public int ActiveChest = -1;
|
||||||
|
public Item ItemInHand = new Item();
|
||||||
|
|
||||||
public virtual void Disable(string reason = "", bool displayConsole = true)
|
public virtual void Disable(string reason = "", bool displayConsole = true)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -393,6 +393,12 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
if (args.Player.IsLoggedIn)
|
if (args.Player.IsLoggedIn)
|
||||||
args.Player.SaveServerCharacter();
|
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)
|
private void NetHooks_NameCollision(NameCollisionEventArgs args)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue