Events are now pushed onto a stack and popped off. Turns out multiple events *CAN* happen. Fixed quantity bugs when saving to DB. Fixed buying stacks.

This commit is contained in:
Filip Maj 2017-12-10 22:32:24 -05:00
parent 08c5980b22
commit a9d4e621e3
7 changed files with 38 additions and 58 deletions

View file

@ -1060,18 +1060,15 @@ namespace FFXIVClassic_Map_Server
if (cost < 0)
return false;
if (itemToBuy.GetBazaarMode() == InventoryItem.TYPE_STACK)
{
itemToBuy.ChangeQuantity(-quantity);
buyer.AddItemStack(itemToBuy.itemId, quantity, itemToBuy.quality);
buyer.GetItemPackage(Inventory.CURRENCY_CRYSTALS).RemoveItem(1000001, cost);
}
else
if (itemToBuy.GetBazaarMode() == InventoryItem.TYPE_SINGLE || itemToBuy.GetBazaarMode() == InventoryItem.TYPE_MULTI || itemToBuy.GetBazaarMode() == InventoryItem.TYPE_STACK)
{
itemToBuy.ChangeQuantity(-quantity);
buyer.AddItem(itemToBuy.itemId, quantity, itemToBuy.quality);
buyer.GetItemPackage(Inventory.CURRENCY_CRYSTALS).RemoveItem(1000001, cost);
}
if (itemToBuy.quantity == 0)
Database.ClearBazaarEntry(bazaar, itemToBuy);
bazaar.CheckBazaarFlags();