Fix GiveItem not working if the player is in lava

This commit is contained in:
gohjoseph 2022-03-21 01:17:30 +08:00
parent 1e5e3cd864
commit 516add7803

View file

@ -1380,7 +1380,9 @@ namespace TShockAPI
public virtual void GiveItem(int type, int stack, int prefix = 0) public virtual void GiveItem(int type, int stack, int prefix = 0)
{ {
int itemIndex = Item.NewItem(new EntitySource_DebugCommand(), (int)X, (int)Y, TPlayer.width, TPlayer.height, type, stack, true, prefix, true); int itemIndex = Item.NewItem(new EntitySource_DebugCommand(), (int)X, (int)Y, TPlayer.width, TPlayer.height, type, stack, true, prefix, true);
SendData(PacketTypes.ItemDrop, "", itemIndex); Main.item[itemIndex].playerIndexTheItemIsReservedFor = this.Index;
SendData(PacketTypes.ItemDrop, "", itemIndex, 1);
SendData(PacketTypes.ItemOwner, null, itemIndex);
} }
/// <summary> /// <summary>