Add nan check to ragfair rating incrementor code
This commit is contained in:
parent
709817d4fe
commit
b478a1cdad
@ -278,8 +278,14 @@ export class RagfairOfferHelper
|
|||||||
*/
|
*/
|
||||||
public increaseProfileRagfairRating(profile: IAkiProfile, amountToIncrementBy: number): void
|
public increaseProfileRagfairRating(profile: IAkiProfile, amountToIncrementBy: number): void
|
||||||
{
|
{
|
||||||
profile.characters.pmc.RagfairInfo.rating += this.ragfairConfig.sell.reputation.gain * amountToIncrementBy;
|
|
||||||
profile.characters.pmc.RagfairInfo.isRatingGrowing = true;
|
profile.characters.pmc.RagfairInfo.isRatingGrowing = true;
|
||||||
|
if (isNaN(amountToIncrementBy))
|
||||||
|
{
|
||||||
|
this.logger.warning(`Unable to increment ragfair rating, value was not a number: ${amountToIncrementBy}`);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
profile.characters.pmc.RagfairInfo.rating += this.ragfairConfig.sell.reputation.gain * amountToIncrementBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,7 +80,7 @@ export class RagfairSellHelper
|
|||||||
sellChancePercent = this.ragfairConfig.sell.chance.base;
|
sellChancePercent = this.ragfairConfig.sell.chance.base;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.debug(`Rolling to sell ${itemSellCount} items (chance: ${sellChancePercent}%)`);
|
this.logger.debug(`Rolling to sell: ${itemSellCount} items (chance: ${sellChancePercent}%)`);
|
||||||
|
|
||||||
// No point rolling for a sale on a 0% chance item, exit early
|
// No point rolling for a sale on a 0% chance item, exit early
|
||||||
if (sellChancePercent === 0)
|
if (sellChancePercent === 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user