If prestige gives head, give head early
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using SPTarkov.DI.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Helpers;
|
using SPTarkov.Server.Core.Helpers;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
@@ -67,6 +68,32 @@ public class PrestigeController(ProfileHelper profileHelper, DatabaseService dat
|
|||||||
profile.SptData.PendingPrestige = pendingPrestige;
|
profile.SptData.PendingPrestige = pendingPrestige;
|
||||||
profile.ProfileInfo.IsWiped = true;
|
profile.ProfileInfo.IsWiped = true;
|
||||||
|
|
||||||
|
var prestigeLevels = databaseService.GetTemplates().Prestige?.Elements ?? [];
|
||||||
|
|
||||||
|
var prestigeRewards = prestigeLevels
|
||||||
|
.Slice(0, pendingPrestige.PrestigeLevel.Value)
|
||||||
|
.SelectMany(prestigeInner => prestigeInner.Rewards);
|
||||||
|
|
||||||
|
var customisationTemplateDb = databaseService.GetTemplates().Customization;
|
||||||
|
|
||||||
|
foreach (var reward in prestigeRewards)
|
||||||
|
{
|
||||||
|
if (!MongoId.IsValidMongoId(reward.Target))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!customisationTemplateDb.TryGetValue(reward.Target, out var template))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (template.Parent == CustomisationTypeId.HEAD)
|
||||||
|
{
|
||||||
|
profileHelper.AddHideoutCustomisationUnlock(profile, reward, CustomisationSource.PRESTIGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await saveServer.SaveProfileAsync(sessionId);
|
await saveServer.SaveProfileAsync(sessionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user