Skip to content

Commit 5c4d051

Browse files
author
Chomp
committed
Make use of randomUtil where possible
1 parent 676734b commit 5c4d051

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

project/src/services/CircleOfCultistService.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class CircleOfCultistService {
114114

115115
const output = this.eventOutputHolder.getOutput(sessionId);
116116

117-
// Remove sacrified items from circle inventory
117+
// Remove sacrificed items from circle inventory
118118
for (const item of sacrificedItems) {
119119
if (item.slotId === CircleOfCultistService.circleOfCultistSlotId) {
120120
this.inventoryHelper.removeItem(pmcData, item._id, sessionId, output);
@@ -430,7 +430,7 @@ export class CircleOfCultistService {
430430

431431
// Handle special case of tagilla helmets
432432
if (directReward.reward.includes(ItemTpl.FACECOVER_TAGILLAS_WELDING_MASK_GORILLA)) {
433-
directReward.reward = [directReward.reward[Math.round(Math.random())]]; // TODO- mathutil
433+
directReward.reward = [this.randomUtil.getArrayValue(directReward.reward)];
434434
}
435435

436436
// Loop because these can include multiple rewards
@@ -481,7 +481,7 @@ export class CircleOfCultistService {
481481

482482
const fullProfile = this.profileHelper.getFullProfile(sessionId);
483483
const directRewardHash = this.getDirectRewardHashKey(matchingDirectReward);
484-
if (fullProfile.spt.cultistRewards.has(directRewardHash)) {
484+
if (fullProfile.spt.cultistRewards?.has(directRewardHash)) {
485485
// Player has already received this direct reward
486486
return null;
487487
}

0 commit comments

Comments
 (0)