Renamed functions to better explain what they do
This commit is contained in:
parent
8c05345b85
commit
3327bc916a
@ -228,7 +228,7 @@ export class InraidController
|
|||||||
// Not dead
|
// Not dead
|
||||||
|
|
||||||
// Check for cultist amulets in special slot (only slot it can fit)
|
// Check for cultist amulets in special slot (only slot it can fit)
|
||||||
const sacredAmulet = this.itemHelper.getItemFromPool(
|
const sacredAmulet = this.itemHelper.getItemFromPoolByTpl(
|
||||||
serverPmcProfile.Inventory.items,
|
serverPmcProfile.Inventory.items,
|
||||||
ItemTpl.SACRED_AMULET,
|
ItemTpl.SACRED_AMULET,
|
||||||
"SpecialSlot");
|
"SpecialSlot");
|
||||||
|
@ -60,7 +60,7 @@ export class ItemHelper
|
|||||||
* @param slotId OPTIONAL - slotid of desired item
|
* @param slotId OPTIONAL - slotid of desired item
|
||||||
* @returns True if pool contains item
|
* @returns True if pool contains item
|
||||||
*/
|
*/
|
||||||
public hasItem(itemPool: Item[], item: ItemTpl, slotId?: string): boolean
|
public hasItemWithTpl(itemPool: Item[], item: ItemTpl, slotId?: string): boolean
|
||||||
{
|
{
|
||||||
// Filter the pool by slotId if provided
|
// Filter the pool by slotId if provided
|
||||||
const filteredPool = (slotId)
|
const filteredPool = (slotId)
|
||||||
@ -72,13 +72,13 @@ export class ItemHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the desired item from provided pool
|
* Get the first item from provided pool with the desired tpl
|
||||||
* @param itemPool Item collection to search
|
* @param itemPool Item collection to search
|
||||||
* @param item Item to look for
|
* @param item Item to look for
|
||||||
* @param slotId OPTIONAL - slotid of desired item
|
* @param slotId OPTIONAL - slotid of desired item
|
||||||
* @returns Item or undefined
|
* @returns Item or undefined
|
||||||
*/
|
*/
|
||||||
public getItemFromPool(itemPool: Item[], item: ItemTpl, slotId?: string): Item | undefined
|
public getItemFromPoolByTpl(itemPool: Item[], item: ItemTpl, slotId?: string): Item | undefined
|
||||||
{
|
{
|
||||||
// Filter the pool by slotId if provided
|
// Filter the pool by slotId if provided
|
||||||
const filteredPool = (slotId)
|
const filteredPool = (slotId)
|
||||||
|
@ -206,7 +206,7 @@ export class InsuranceService
|
|||||||
let randomisedReturnTimeSeconds = this.randomUtil.getInt(traderMinReturnAsSeconds, traderMaxReturnAsSeconds);
|
let randomisedReturnTimeSeconds = this.randomUtil.getInt(traderMinReturnAsSeconds, traderMaxReturnAsSeconds);
|
||||||
|
|
||||||
// Check for Mark of The Unheard in players special slots (only slot item can fit)
|
// Check for Mark of The Unheard in players special slots (only slot item can fit)
|
||||||
const hasMarkOfUnheard = this.itemHelper.hasItem(
|
const hasMarkOfUnheard = this.itemHelper.hasItemWithTpl(
|
||||||
pmcData.Inventory.items,
|
pmcData.Inventory.items,
|
||||||
ItemTpl.MARK_OF_UNHEARD,
|
ItemTpl.MARK_OF_UNHEARD,
|
||||||
"SpecialSlot");
|
"SpecialSlot");
|
||||||
|
Loading…
Reference in New Issue
Block a user