Fix ItemMapper whitelist mispredict when inserting or removing items
This commit is contained in:
@@ -17,8 +17,8 @@ namespace Content.Shared.Storage.Components
|
||||
{
|
||||
public string Layer = string.Empty;
|
||||
|
||||
[DataField("whitelist", required: true, serverOnly: true)]
|
||||
public EntityWhitelist ServerWhitelist { get; set; } = new();
|
||||
[DataField("whitelist", required: true)]
|
||||
public EntityWhitelist? ServerWhitelist { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Minimal amount of entities that are valid for whitelist.
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Content.Shared.Storage.EntitySystems
|
||||
var list = new List<string>();
|
||||
foreach (var mapLayerData in itemMapper.MapLayers.Values)
|
||||
{
|
||||
var count = containedLayers.Count(ent => mapLayerData.ServerWhitelist.IsValid(ent));
|
||||
var count = containedLayers.Count(ent => mapLayerData.ServerWhitelist!.IsValid(ent));
|
||||
if (count >= mapLayerData.MinCount && count <= mapLayerData.MaxCount)
|
||||
{
|
||||
list.Add(mapLayerData.Layer);
|
||||
|
||||
Reference in New Issue
Block a user