Skip to content

Commit

Permalink
Update ClientPreferencesManager.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgencheg authored Oct 14, 2024
1 parent 9b0dabb commit 46e7f2a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Content.Client/Preferences/ClientPreferencesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ public void UpdateCharacter(ICharacterProfile profile, int slot)
var collection = IoCManager.Instance!;

#if LPP_Sponsors // _LostParadise-Sponsors
var allowedMarkings = _sponsorsManager.TryGetInfo(out var sponsor) ? sponsor.AllowedMarkings : Array.Empty<string>();
if (sponsor != null)
{
var tier = sponsor.Tier > 5 ? 5 : sponsor.Tier;
allowedMarkings = allowedMarkings.Concat(Loc.GetString($"sponsor-markings-tier-{tier}").Split(";", StringSplitOptions.RemoveEmptyEntries)).ToArray();
}
var session = _playerManager.LocalSession!;
profile.EnsureValid(session, collection, allowedMarkings);
var allowedMarkings = _sponsorsManager.TryGetInfo(out var sponsor) ? sponsor.AllowedMarkings : Array.Empty<string>();
if (allowedMarkings is null) // Somehow
allowedMarkings = Array.Empty<string>();
if (sponsor != null)
{
var tier = sponsor.Tier > 5 ? 5 : sponsor.Tier;
var sponsorMarkings = Loc.GetString($"sponsor-markings-tier-{tier}").Split(";", StringSplitOptions.RemoveEmptyEntries);
if (sponsorMarkings is not null && sponsorMarkings.Count > 0)
allowedMarkings = allowedMarkings.Concat(sponsorMarkings).ToArray();
}
#else
profile.EnsureValid(_playerManager.LocalSession!, collection);
#endif
Expand Down

0 comments on commit 46e7f2a

Please sign in to comment.