FIx getFleaPriceForItem() not logging when price was not found

This commit is contained in:
Dev 2023-04-23 11:25:42 +01:00
parent 9ddfeb629e
commit c20a9d6e36

View File

@ -97,16 +97,14 @@ export class RagfairPriceService implements OnLoad
public getFleaPriceForItem(tplId: string): number
{
// Get dynamic price (templates/prices), if that doesnt exist get price from static array (templates/handbook)
let itemPrice = this.getDynamicPriceForItem(tplId);
if (!itemPrice || itemPrice === 1)
{
itemPrice = this.getStaticPriceForItem(tplId);
}
let itemPrice = this.getDynamicPriceForItem(tplId) || this.getStaticPriceForItem(tplId);
if (!itemPrice)
// If no price in dynamic/static, set to 1
itemPrice = itemPrice || 1;
if (itemPrice === 1)
{
this.logger.debug(`Missing item price for ${tplId}`);
itemPrice = 1;
}
return itemPrice;