1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-23 05:07:47 +00:00

More cleanup.

This commit is contained in:
Filip Maj 2017-09-09 12:42:00 -04:00
parent 9174801fdb
commit 52c707d66e

View file

@ -126,10 +126,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
isDirty[i] = true; isDirty[i] = true;
quantityCount -= (gItem.maxStack - oldQuantity); quantityCount -= (gItem.maxStack - oldQuantity);
if (owner is Player) DoDatabaseQuantity(item.uniqueId, item.quantity);
{
DoDatabaseQuantity(item.uniqueId, item.quantity);
}
if (quantityCount <= 0) if (quantityCount <= 0)
break; break;
@ -156,10 +153,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
DoDatabaseAdd(addedItem); DoDatabaseAdd(addedItem);
} }
if (owner is Player) SendUpdatePackets();
{
SendUpdatePackets((Player)owner);
}
return true; return true;
} }
@ -220,8 +214,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
} }
DoRealign(); DoRealign();
if (owner is Player) SendUpdatePackets();
SendUpdatePackets((Player)owner);
} }
public void RemoveItemByUniqueId(ulong itemDBId) public void RemoveItemByUniqueId(ulong itemDBId)
@ -251,8 +244,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
isDirty[slot] = true; isDirty[slot] = true;
DoRealign(); DoRealign();
if (owner is Player) SendUpdatePackets();
SendUpdatePackets((Player)owner);
} }
public void RemoveItemAtSlot(ushort slot) public void RemoveItemAtSlot(ushort slot)
@ -266,8 +258,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
isDirty[slot] = true; isDirty[slot] = true;
DoRealign(); DoRealign();
if (owner is Player) SendUpdatePackets();
SendUpdatePackets((Player)owner);
} }
public void RemoveItemAtSlot(ushort slot, int quantity) public void RemoveItemAtSlot(ushort slot, int quantity)
@ -290,8 +281,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
DoDatabaseQuantity(list[slot].uniqueId, list[slot].quantity); DoDatabaseQuantity(list[slot].uniqueId, list[slot].quantity);
isDirty[slot] = true; isDirty[slot] = true;
if (owner is Player) SendUpdatePackets((Player)owner);
SendUpdatePackets((Player)owner);
} }
} }
@ -431,7 +421,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
#endregion #endregion
#region Client and DB Updating #region Automatic Client and DB Updating
private void DoDatabaseAdd(InventoryItem addedItem) private void DoDatabaseAdd(InventoryItem addedItem)
{ {
@ -472,6 +462,12 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
} }
} }
private void SendUpdatePackets()
{
if (owner is Player)
SendUpdatePackets((Player)owner);
}
private void SendUpdatePackets(Player player) private void SendUpdatePackets(Player player)
{ {
List<InventoryItem> items = new List<InventoryItem>(); List<InventoryItem> items = new List<InventoryItem>();