diff --git a/project/src/helpers/ItemHelper.ts b/project/src/helpers/ItemHelper.ts index f4609d4f..fc01aa39 100644 --- a/project/src/helpers/ItemHelper.ts +++ b/project/src/helpers/ItemHelper.ts @@ -187,7 +187,13 @@ export class ItemHelper { } /** - * Checks if an id is a valid item. Valid meaning that it's an item that be stored in stash + * Checks if a tpl is a valid item. Valid meaning that it's an item that be stored in stash + * Valid means: + * Not quest item + * 'Item' type + * Not on the invalid base types array + * Price above 0 roubles + * Not on item config blacklist * @param {string} tpl the template id / tpl * @returns boolean; true for items that may be in player possession and not quest items */ diff --git a/project/src/helpers/RagfairServerHelper.ts b/project/src/helpers/RagfairServerHelper.ts index 376e7da2..aef98c90 100644 --- a/project/src/helpers/RagfairServerHelper.ts +++ b/project/src/helpers/RagfairServerHelper.ts @@ -62,8 +62,7 @@ export class RagfairServerHelper { return false; } - // Skip blacklisted items - if (this.itemFilterService.isItemBlacklisted(itemDetails[1]._id)) { + if (!this.itemHelper.isValidItem(itemDetails[1]._id)) { return false; } @@ -72,8 +71,10 @@ export class RagfairServerHelper { return false; } - // Skip custom blacklisted items + // Skip custom blacklisted items and flag as unsellable by players if (this.isItemOnCustomFleaBlacklist(itemDetails[1]._id)) { + itemDetails[1]._props.CanSellOnRagfair = false; + return false; } @@ -108,10 +109,6 @@ export class RagfairServerHelper { * @returns True if its blacklsited */ protected isItemOnCustomFleaBlacklist(itemTemplateId: string): boolean { - if (!this.itemHelper.isValidItem(itemTemplateId)) { - return true; - } - return this.ragfairConfig.dynamic.blacklist.custom.includes(itemTemplateId); }