Fix range check on item clearing to refer to the Main.item[] being cleared and not the fake coordinates being sent by the client.
This commit is contained in:
parent
eb7f66b986
commit
61d05ffdc6
1 changed files with 11 additions and 5 deletions
|
|
@ -2989,17 +2989,23 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == 0) //Item removed, let client do this to prevent item duplication client side (but only if it passed the range check)
|
||||||
|
{
|
||||||
|
if (TShock.CheckRangePermission(args.Player, (int)(Main.item[id].position.X / 16f), (int)(Main.item[id].position.Y / 16f)))
|
||||||
|
{
|
||||||
|
args.Player.SendData(PacketTypes.ItemDrop, "", id);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (TShock.CheckRangePermission(args.Player, (int)(pos.X / 16f), (int)(pos.Y / 16f)))
|
if (TShock.CheckRangePermission(args.Player, (int)(pos.X / 16f), (int)(pos.Y / 16f)))
|
||||||
{
|
{
|
||||||
args.Player.SendData(PacketTypes.ItemDrop, "", id);
|
args.Player.SendData(PacketTypes.ItemDrop, "", id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == 0) //Item removed, let client do this to prevent item duplication client side (but only if it passed the range check above)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Main.item[id].active && Main.item[id].netID != type) //stop the client from changing the item type of a drop but only if the client isn't picking up the item
|
if (Main.item[id].active && Main.item[id].netID != type) //stop the client from changing the item type of a drop but only if the client isn't picking up the item
|
||||||
{
|
{
|
||||||
args.Player.SendData(PacketTypes.ItemDrop, "", id);
|
args.Player.SendData(PacketTypes.ItemDrop, "", id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue