Skip to content

Commit

Permalink
fix: Add DistinctBy to VoidDictionary and WhitelistDictionary to avoi…
Browse files Browse the repository at this point in the history
…d possible collision due to manually added entries
  • Loading branch information
SheepGoMeh committed Oct 27, 2024
1 parent 6501dcf commit e6f1581
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Visibility/Configuration/VisibilityConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class VisibilityConfiguration: IPluginConfiguration

public void Init(ushort territoryType)
{
this.VoidDictionary = this.VoidList.Where(x => x.Id != 0).ToDictionary(x => x.Id, x => x);
this.WhitelistDictionary = this.Whitelist.Where(x => x.Id != 0).ToDictionary(x => x.Id, x => x);
this.VoidDictionary = this.VoidList.Where(x => x.Id != 0).DistinctBy(x => x.Id).ToDictionary(x => x.Id, x => x);
this.WhitelistDictionary = this.Whitelist.Where(x => x.Id != 0).DistinctBy(x => x.Id).ToDictionary(x => x.Id, x => x);

this.SettingDictionary[nameof(this.Enabled)] = (val, toggle, _) =>
{
Expand Down
2 changes: 1 addition & 1 deletion Visibility/Visibility.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<LangVersion>default</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<AssemblyVersion>1.1.8.0</AssemblyVersion>
<AssemblyVersion>1.1.8.1</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<IsPackable>false</IsPackable>
<Authors>SheepGoMeh</Authors>
Expand Down

0 comments on commit e6f1581

Please sign in to comment.