mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
Renamed Type7Param to ItemRefParam. Changed a lot of "inventoryType" names to "itemPackage". Moved inventory code to Character class for easier use and auto-choosing the correct package.
This commit is contained in:
@@ -126,6 +126,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
return INV_ERROR.SYSTEM_ERROR;
|
||||
}
|
||||
|
||||
itemRef.RefreshPositioning(inventoryCode, (ushort) endOfListIndex);
|
||||
|
||||
isDirty[endOfListIndex] = true;
|
||||
list[endOfListIndex++] = itemRef;
|
||||
DoDatabaseAdd(itemRef);
|
||||
@@ -265,10 +267,15 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
public void RemoveItem(InventoryItem item)
|
||||
{
|
||||
RemoveItemByUniqueId(item.uniqueId);
|
||||
}
|
||||
|
||||
public void RemoveItemByUniqueId(ulong itemDBId)
|
||||
RemoveItemByUniqueId(item.uniqueId, 1);
|
||||
}
|
||||
|
||||
public void RemoveItem(InventoryItem item, int quantity)
|
||||
{
|
||||
RemoveItemByUniqueId(item.uniqueId, quantity);
|
||||
}
|
||||
|
||||
public void RemoveItemByUniqueId(ulong itemDBId, int quantity)
|
||||
{
|
||||
ushort slot = 0;
|
||||
InventoryItem toDelete = null;
|
||||
@@ -288,10 +295,18 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
||||
if (toDelete == null)
|
||||
return;
|
||||
|
||||
if (quantity >= toDelete.quantity)
|
||||
{
|
||||
DoDatabaseRemove(toDelete.uniqueId);
|
||||
list[slot] = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
list[slot].quantity -= quantity;
|
||||
//DoDatabaseUpdateQuantity(toDelete.uniqueId);
|
||||
}
|
||||
|
||||
DoDatabaseRemove(toDelete.uniqueId);
|
||||
|
||||
list[slot] = null;
|
||||
isDirty[slot] = true;
|
||||
|
||||
DoRealign();
|
||||
|
Reference in New Issue
Block a user