Adding EntitySource parameter to the used at NewNPC and NewItem methods.
I've decided to use the DebugCommand entity source for anything server related, as it makes the most sense as source. Feel free to discuss.
This commit is contained in:
parent
2f31322b5f
commit
1b96ed8992
2 changed files with 3 additions and 2 deletions
|
|
@ -1379,7 +1379,7 @@ namespace TShockAPI
|
|||
/// <param name="prefix">The item prefix.</param>
|
||||
public virtual void GiveItem(int type, int stack, int prefix = 0)
|
||||
{
|
||||
int itemIndex = Item.NewItem((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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ using TShockAPI;
|
|||
using TShockAPI.DB;
|
||||
using Terraria.Localization;
|
||||
using System.Linq;
|
||||
using Terraria.DataStructures;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -166,7 +167,7 @@ namespace TShockAPI
|
|||
int spawnTileY;
|
||||
TShock.Utils.GetRandomClearTileWithInRange(startTileX, startTileY, tileXRange, tileYRange, out spawnTileX,
|
||||
out spawnTileY);
|
||||
NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type);
|
||||
NPC.NewNPC(new EntitySource_DebugCommand(), spawnTileX * 16, spawnTileY * 16, type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue