#747 Fixed items added to ragfair configs custom blacklist still be sellable on flea by player
Moved confusing `isValidItem()` check out of `isItemOnCustomFleaBlacklist()` and into main function
Removed redundant blacklist check from flea item generation as its already covered in `isValidItem()`
(cherry picked from commit f46694a169
)
This commit is contained in:
parent
a4a3c8c89a
commit
093afe002c
@ -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
|
||||
*/
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user