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 public getFleaPriceForItem(tplId: string): number
{ {
// Get dynamic price (templates/prices), if that doesnt exist get price from static array (templates/handbook) // Get dynamic price (templates/prices), if that doesnt exist get price from static array (templates/handbook)
let itemPrice = this.getDynamicPriceForItem(tplId); let itemPrice = this.getDynamicPriceForItem(tplId) || this.getStaticPriceForItem(tplId);
if (!itemPrice || itemPrice === 1)
{
itemPrice = 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}`); this.logger.debug(`Missing item price for ${tplId}`);
itemPrice = 1;
} }
return itemPrice; return itemPrice;