Replaced getFleaPriceForItem() check for value = 1 with undefined check + move code above undefined = 1assignment
This commit is contained in:
parent
28ca90b02c
commit
da6cbee387
@ -118,15 +118,14 @@ export class RagfairPriceService implements OnLoad
|
|||||||
{
|
{
|
||||||
// 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) || 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.warning(`Missing live flea or handbook item price for ${tplId}, defaulting to 1, if this is a modded item contact the mods author`);
|
this.logger.warning(`Missing live flea or handbook item price for ${tplId}, defaulting to 1, if this is a modded item contact the mods author`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If no price in dynamic/static, set to 1
|
||||||
|
itemPrice = itemPrice || 1;
|
||||||
|
|
||||||
return itemPrice;
|
return itemPrice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user