Skip to content

Commit

Permalink
Update ClientPreferencesManager.cs (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgencheg authored Oct 14, 2024
1 parent 9b0dabb commit 0bb445b
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)

Check failure on line 85 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / YAML Linter Secrets

Operator '>' cannot be applied to operands of type 'method group' and 'int'

Check failure on line 85 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / YAML Linter Secrets

Operator '>' cannot be applied to operands of type 'method group' and 'int'

Check failure on line 85 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Operator '>' cannot be applied to operands of type 'method group' and 'int'

Check failure on line 85 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Operator '>' cannot be applied to operands of type 'method group' and 'int'

Check failure on line 85 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / Test Packaging Secrets

Operator '>' cannot be applied to operands of type 'method group' and 'int'

Check failure on line 85 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / Test Packaging Secrets

Operator '>' cannot be applied to operands of type 'method group' and 'int'
allowedMarkings = allowedMarkings.Concat(sponsorMarkings).ToArray();

Check failure on line 86 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Possible null reference argument for parameter 'second' in 'IEnumerable<string> Enumerable.Concat<string>(IEnumerable<string> first, IEnumerable<string> second)'.

Check failure on line 86 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Possible null reference argument for parameter 'second' in 'IEnumerable<string> Enumerable.Concat<string>(IEnumerable<string> first, IEnumerable<string> second)'.

Check failure on line 86 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / Test Packaging Secrets

Possible null reference argument for parameter 'second' in 'IEnumerable<string> Enumerable.Concat<string>(IEnumerable<string> first, IEnumerable<string> second)'.

Check failure on line 86 in Content.Client/Preferences/ClientPreferencesManager.cs

View workflow job for this annotation

GitHub Actions / Test Packaging Secrets

Possible null reference argument for parameter 'second' in 'IEnumerable<string> Enumerable.Concat<string>(IEnumerable<string> first, IEnumerable<string> second)'.
}
#else
profile.EnsureValid(_playerManager.LocalSession!, collection);
#endif
Expand Down

0 comments on commit 0bb445b

Please sign in to comment.