Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1090 Prestige 1 rewards re-locked after prestiging a 2nd time. #1091

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading