Allow unreasonable item price code to work with item sub types

This commit is contained in:
Dev 2024-02-09 22:28:25 +00:00
parent 4b9f2ddbd1
commit d3f66a85a0

View File

@ -285,7 +285,16 @@ export class RagfairPriceService implements OnLoad
if (items.length === 1)
{
const rootItemDb = this.itemHelper.getItem(rootItem._tpl)[1];
const unreasonableItemPriceChange = this.ragfairConfig.dynamic.unreasonableModPrices[rootItemDb._parent];
let unreasonableItemPriceChange: IUnreasonableModPrices;
for (const key of Object.keys(this.ragfairConfig.dynamic.unreasonableModPrices))
{
if (this.itemHelper.isOfBaseclass(rootItemDb._id, key))
{
unreasonableItemPriceChange = this.ragfairConfig.dynamic.unreasonableModPrices[key];
break;
}
}
if (unreasonableItemPriceChange?.enabled)
{
price = this.adjustUnreasonablePrice(