Fix: remove ability to buy items from a vendor if they don't sell said item (#1105)

This commit is contained in:
David Markowitz
2023-06-03 00:40:46 -07:00
committed by GitHub
parent 9fabff16e4
commit 8ae1e1bc6b
3 changed files with 13 additions and 2 deletions

View File

@@ -134,3 +134,7 @@ void VendorComponent::SetupConstants() {
m_RefreshTimeSeconds = vendorComps[0].refreshTimeSeconds;
m_LootMatrixID = vendorComps[0].LootMatrixIndex;
}
bool VendorComponent::SellsItem(const LOT item) const {
return m_Inventory.find(item) != m_Inventory.end();
}

View File

@@ -67,6 +67,8 @@ public:
* Called on startup of vendor to setup the variables for the component.
*/
void SetupConstants();
bool SellsItem(const LOT item) const;
private:
/**
* The buy scalar.