mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Fix incorrect calculation for normal fence assort count
This commit is contained in:
parent
1c660fcf4e
commit
a5924dbe0d
@ -330,9 +330,8 @@ export class FenceService
|
|||||||
*/
|
*/
|
||||||
protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues
|
protected getCountOfItemsToGenerate(): IFenceAssortGenerationValues
|
||||||
{
|
{
|
||||||
const rootPresetItems = this.fenceAssort.items.filter((item) =>
|
const allRootItems = this.fenceAssort.items.filter((item) => item.slotId === "hideout");
|
||||||
item.slotId === "hideout" && item.upd.sptPresetId
|
const rootPresetItems = allRootItems.filter((item) => item.upd.sptPresetId);
|
||||||
);
|
|
||||||
|
|
||||||
// Get count of weapons
|
// Get count of weapons
|
||||||
const currentWeaponPresetCount = rootPresetItems.reduce((count, item) =>
|
const currentWeaponPresetCount = rootPresetItems.reduce((count, item) =>
|
||||||
@ -347,8 +346,7 @@ export class FenceService
|
|||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
// Normal item count is total count minus weapon + armor count
|
// Normal item count is total count minus weapon + armor count
|
||||||
const itemAssortCount = Object.keys(this.fenceAssort.loyal_level_items).length
|
const itemAssortCount = allRootItems.length - (currentWeaponPresetCount + currentEquipmentPresetCount);
|
||||||
- (currentWeaponPresetCount + currentEquipmentPresetCount);
|
|
||||||
|
|
||||||
// Get counts of items to generate, never let values fall below 0
|
// Get counts of items to generate, never let values fall below 0
|
||||||
const itemCountToGenerate = Math.max(this.desiredAssortCounts.normal.item - itemAssortCount, 0);
|
const itemCountToGenerate = Math.max(this.desiredAssortCounts.normal.item - itemAssortCount, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user