Fixed new positions after realignment not saving. Fixed Dealer info not clearing from the db sometimes.

This commit is contained in:
Filip Maj
2019-06-08 14:46:19 -04:00
parent e91960040c
commit a07aa12783
4 changed files with 67 additions and 3 deletions

View File

@@ -826,7 +826,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
private void DoRealign()
{
int lastNullSlot = -1;
List<InventoryItem> positionUpdate = new List<InventoryItem>();
int lastNullSlot = -1;
for (int i = 0; i < endOfListIndex; i++)
{
@@ -838,7 +840,12 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
else if (list[i] != null && lastNullSlot != -1)
{
list[lastNullSlot] = list[i];
if (list[lastNullSlot].GetOfferedTo() != null)
{
list[lastNullSlot].UpdateOfferedSlot((ushort)(list[lastNullSlot].slot - lastNullSlot));
}
list[lastNullSlot].slot = (ushort)lastNullSlot;
positionUpdate.Add(list[lastNullSlot]);
list[i] = null;
isDirty[lastNullSlot] = true;
isDirty[i] = true;
@@ -848,6 +855,8 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
if (lastNullSlot != -1)
endOfListIndex = lastNullSlot;
Database.UpdateItemPositions(positionUpdate);
}
#endregion