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:
Zack Piispanen 2014-04-09 18:37:41 -04:00
parent eb7f66b986
commit 61d05ffdc6

View file

@ -2989,17 +2989,23 @@ namespace TShockAPI
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)))
{
args.Player.SendData(PacketTypes.ItemDrop, "", id);
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
{
args.Player.SendData(PacketTypes.ItemDrop, "", id);