0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

Revert "Better handle cultist rewards not fitting the container (#979)"

This reverts commit 8d05bf0069b22968d7e4fcdc4901ae0babd948c3, reversing
changes made to d5ce6c4d709f000972ae9f9fdb596eba98184f29.
This commit is contained in:
Chomp 2024-12-09 23:30:22 +00:00
parent 8d05bf0069
commit ee07bd8c0f

View File

@ -124,7 +124,7 @@ export class CircleOfCultistService {
} }
} }
let rewards = hasDirectReward const rewards = hasDirectReward
? this.getDirectRewards(sessionId, directRewardSettings, cultistCircleStashId) ? this.getDirectRewards(sessionId, directRewardSettings, cultistCircleStashId)
: this.getRewardsWithinBudget( : this.getRewardsWithinBudget(
this.getCultistCircleRewardPool(sessionId, pmcData, craftingInfo, this.hideoutConfig.cultistCircle), this.getCultistCircleRewardPool(sessionId, pmcData, craftingInfo, this.hideoutConfig.cultistCircle),
@ -138,9 +138,7 @@ export class CircleOfCultistService {
// Ensure rewards fit into container // Ensure rewards fit into container
const containerGrid = this.inventoryHelper.getContainerSlotMap(cultistStashDbItem[1]._id); const containerGrid = this.inventoryHelper.getContainerSlotMap(cultistStashDbItem[1]._id);
let canAddToContainer = false; const canAddToContainer = this.inventoryHelper.canPlaceItemsInContainer(
while (!canAddToContainer && rewards.length > 0) {
canAddToContainer = this.inventoryHelper.canPlaceItemsInContainer(
this.cloner.clone(containerGrid), // MUST clone grid before passing in as function modifies grid this.cloner.clone(containerGrid), // MUST clone grid before passing in as function modifies grid
rewards, rewards,
); );
@ -158,8 +156,9 @@ export class CircleOfCultistService {
pmcData.Inventory.items.push(...itemToAdd); pmcData.Inventory.items.push(...itemToAdd);
} }
} else { } else {
rewards.pop(); this.logger.error(
} `Unable to fit all: ${rewards.length} reward items into sacrifice grid, nothing will be returned (rewards so valuable cultists stole it)`,
);
} }
return output; return output;