mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Fixes Prestige rewards not persisting through Prestige
Whenever we prestige we have to add all previous prestige rewards to the fresh profile, not only the current one. Fixes #1090
This commit is contained in:
parent
743a78c5c9
commit
d64cde21bf
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user