mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 21:55:42 +12:00
Fix items not removed from stores
This commit is contained in:
parent
d32ce1c73f
commit
f3e80cad74
1 changed files with 14 additions and 0 deletions
|
@ -7954,12 +7954,26 @@ namespace HISP.Server
|
||||||
foreach (GameClient connectedClient in GameClient.ConnectedClients)
|
foreach (GameClient connectedClient in GameClient.ConnectedClients)
|
||||||
{
|
{
|
||||||
if (connectedClient.LoggedIn)
|
if (connectedClient.LoggedIn)
|
||||||
|
{
|
||||||
if (connectedClient.LoggedinUser.Inventory.HasItemId(id))
|
if (connectedClient.LoggedinUser.Inventory.HasItemId(id))
|
||||||
{
|
{
|
||||||
InventoryItem invItm = connectedClient.LoggedinUser.Inventory.GetItemByItemId(id);
|
InventoryItem invItm = connectedClient.LoggedinUser.Inventory.GetItemByItemId(id);
|
||||||
foreach (ItemInstance itm in invItm.ItemInstances.ToArray())
|
foreach (ItemInstance itm in invItm.ItemInstances.ToArray())
|
||||||
connectedClient.LoggedinUser.Inventory.Remove(itm);
|
connectedClient.LoggedinUser.Inventory.Remove(itm);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove from shops
|
||||||
|
foreach(Shop shop in Shop.ShopList)
|
||||||
|
{
|
||||||
|
if (shop.Inventory.HasItemId(id))
|
||||||
|
{
|
||||||
|
InventoryItem invItm = shop.Inventory.GetItemByItemId(id);
|
||||||
|
foreach (ItemInstance itm in invItm.ItemInstances.ToArray())
|
||||||
|
shop.Inventory.Remove(itm);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
DroppedItems.DeleteAllItemsWithId(id); // Delete all dropped items
|
DroppedItems.DeleteAllItemsWithId(id); // Delete all dropped items
|
||||||
Database.DeleteAllItemsFromUsers(id); // Delete from offline players
|
Database.DeleteAllItemsFromUsers(id); // Delete from offline players
|
||||||
|
|
Loading…
Add table
Reference in a new issue