Skip to content

Commit

Permalink
Merge branch '4.0.0-DEV' of https://github.com/sp-tarkov/server into …
Browse files Browse the repository at this point in the history
…4.0.0-DEV
  • Loading branch information
Chomp committed Jan 17, 2025
2 parents df4c6c1 + 40c3931 commit aae4f50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions project/src/controllers/PrestigeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@ export class PrestigeController {

const indexOfPrestigeObtained = Math.min(createRequest.sptForcePrestigeLevel - 1, 1); // Index starts at 0
// Assumes Prestige data is in descending order
const matchingPrestigeData = this.databaseService.getTemplates().prestige.elements[indexOfPrestigeObtained];
const currentPrestigeData = this.databaseService.getTemplates().prestige.elements[indexOfPrestigeObtained];
const prestigeRewards = this.databaseService
.getTemplates()
.prestige.elements.slice(0, indexOfPrestigeObtained + 1)
.flatMap((prestige) => prestige.rewards);

this.addPrestigeRewardsToProfile(sessionId, newProfile, matchingPrestigeData.rewards);
this.addPrestigeRewardsToProfile(sessionId, newProfile, prestigeRewards);

// Flag profile as having achieved this prestige level
newProfile.characters.pmc.Prestige[matchingPrestigeData.id] = this.timeUtil.getTimestamp();
newProfile.characters.pmc.Prestige[currentPrestigeData.id] = this.timeUtil.getTimestamp();

// Copy transferred items
for (const transferRequest of request) {
Expand Down

0 comments on commit aae4f50

Please sign in to comment.