From 1bb650af912a5e19428be0ac4c5901cfe4807da4 Mon Sep 17 00:00:00 2001 From: Platinum Date: Sat, 11 Feb 2023 17:32:31 +1100 Subject: [PATCH] Change base mult from 2 to 1 because it messes with a lot of items --- advancedConfig.json | 2 +- config.json | 3 +-- src/mod.ts | 8 +++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/advancedConfig.json b/advancedConfig.json index e121d5b..9136252 100644 --- a/advancedConfig.json +++ b/advancedConfig.json @@ -1,6 +1,6 @@ { "baselineBulletId": "59e6906286f7746c9f75e847", - "baselineBulletPrice": 2000, + "baselineBulletPrice": 3000, "bulletDamageMultiplierRedutionFactor": 0.7, "baselineArmourId": "5c0e655586f774045612eeb2", "baselineArmourWeight": 10, diff --git a/config.json b/config.json index 32d078a..591fc81 100644 --- a/config.json +++ b/config.json @@ -1,8 +1,7 @@ { "startDelayInSeconds": 7, "disableBsgBlacklist": true, - "canSellBlacklistedItemsOnFlea": true, - "blacklistedItemPriceMultiplier": 2, + "blacklistedItemPriceMultiplier": 1, "blacklistedAmmoAdditionalPriceMultiplier": 1, "blacklistedArmourAdditionalPriceMultiplier": 1, "customItemConfigs": [ diff --git a/src/mod.ts b/src/mod.ts index 26f5817..a28ee68 100644 --- a/src/mod.ts +++ b/src/mod.ts @@ -86,7 +86,7 @@ class TheBlacklistMod implements IPostDBLoadMod { const itemProps = item._props; if (!itemProps.CanSellOnRagfair) { - itemProps.CanSellOnRagfair = config.canSellBlacklistedItemsOnFlea; + itemProps.CanSellOnRagfair = config.disableBsgBlacklist; prices[item._id] = this.getUpdatedPrice(item, prices); @@ -111,7 +111,7 @@ class TheBlacklistMod implements IPostDBLoadMod { }); } - private getUpdatedPrice(item: ITemplateItem, prices: Record) { + private getUpdatedPrice(item: ITemplateItem, prices: Record): number | undefined { // Note that this price can be affected by other mods like Lua's market updater. const currentFleaPrice = prices[item._id]; let newPrice: number; @@ -122,7 +122,9 @@ class TheBlacklistMod implements IPostDBLoadMod { newPrice = this.getUpdatedArmourPrice(item, prices); } - return newPrice ? newPrice * config.blacklistedItemPriceMultiplier : currentFleaPrice; + // Avoids NaN. Also we shouldn't have any prices of 0. + const price = newPrice || currentFleaPrice; + return price && price * config.blacklistedItemPriceMultiplier; } private getUpdatedAmmoPrice(item: ITemplateItem) {