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;
|
public string Layer = string.Empty;
|
||||||
|
|
||||||
[DataField("whitelist", required: true, serverOnly: true)]
|
[DataField("whitelist", required: true)]
|
||||||
public EntityWhitelist ServerWhitelist { get; set; } = new();
|
public EntityWhitelist? ServerWhitelist { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Minimal amount of entities that are valid for whitelist.
|
/// Minimal amount of entities that are valid for whitelist.
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ namespace Content.Shared.Storage.EntitySystems
|
|||||||
var list = new List<string>();
|
var list = new List<string>();
|
||||||
foreach (var mapLayerData in itemMapper.MapLayers.Values)
|
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)
|
if (count >= mapLayerData.MinCount && count <= mapLayerData.MaxCount)
|
||||||
{
|
{
|
||||||
list.Add(mapLayerData.Layer);
|
list.Add(mapLayerData.Layer);
|
||||||
|
|||||||
Reference in New Issue
Block a user