(Feat) Item Dqta

This commit is contained in:
2026-06-25 14:40:21 +02:00
parent 3597bacb1a
commit 931bc9c9e2
10 changed files with 372 additions and 20 deletions
@@ -24,6 +24,7 @@ namespace Ashwild.Network
{
public ushort itemId;
public int quantity;
public int uses;
public Vector3 position;
public Quaternion rotation;
}
@@ -135,7 +136,7 @@ namespace Ashwild.Network
ItemData item = ItemDatabase.Instance != null ? ItemDatabase.Instance.GetItem(record.itemId) : null;
activeDrops.Remove(id);
if (item != null) inventory.GrantItemFromServer(item, record.quantity);
if (item != null) inventory.GrantItemFromServer(item, record.quantity, record.uses);
}
}
@@ -143,7 +144,7 @@ namespace Ashwild.Network
/// Owner-side entry: asks the server to spawn a dropped item into the world.
/// </summary>
[ServerRpc(RequireOwnership = false)]
public void RequestDropServerRpc(ushort itemId, int quantity, Vector3 position, Quaternion rotation, NetworkConnection conn = null)
public void RequestDropServerRpc(ushort itemId, int quantity, int uses, Vector3 position, Quaternion rotation, NetworkConnection conn = null)
{
if (ItemDatabase.Instance == null || ItemDatabase.Instance.GetItem(itemId) == null) return;
@@ -152,6 +153,7 @@ namespace Ashwild.Network
{
itemId = itemId,
quantity = quantity,
uses = uses,
position = position,
rotation = rotation
});