More inventory fixing after I broke it. Added preliminary final trade code. Moved recalc stats to the end of equipcommand, not on every modification of the referred item package.

This commit is contained in:
Filip Maj 2019-06-04 00:11:36 -04:00
parent 88ff22e55e
commit 69d4b19979
13 changed files with 388 additions and 170 deletions

View file

@ -1131,13 +1131,10 @@ namespace FFXIVClassic_Map_Server
}
public static uint[] GetEquipment(Player player, ushort classId)
public static InventoryItem[] GetEquipment(Player player, ushort classId)
{
uint[] equipment = new uint[player.GetEquipment().GetCapacity()];
for (int i = 0; i < equipment.Length; i++)
equipment[i] = 0xFFFFFFFF;
InventoryItem[] equipment = new InventoryItem[player.GetEquipment().GetCapacity()];
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
try
@ -1162,7 +1159,7 @@ namespace FFXIVClassic_Map_Server
ushort equipSlot = reader.GetUInt16(0);
ulong uniqueItemId = reader.GetUInt16(1);
InventoryItem item = player.GetItemPackage(ItemPackage.NORMAL).GetItemByUniqueId(uniqueItemId);
equipment[equipSlot] = (uint)((item.itemPackage << 16) | item.slot);
equipment[equipSlot] = item;
}
}
}