diff --git a/Subsurface/Source/Items/ItemPrefab.cs b/Subsurface/Source/Items/ItemPrefab.cs index 574fb1be1..91ce91db1 100644 --- a/Subsurface/Source/Items/ItemPrefab.cs +++ b/Subsurface/Source/Items/ItemPrefab.cs @@ -277,6 +277,9 @@ namespace Barotrauma DeconstructItems = new List(); DeconstructTime = 1.0f; + tags = new List(); + tags.AddRange(ToolBox.GetAttributeString(element, "tags", "").Split(',')); + foreach (XElement subElement in element.Elements()) { switch (subElement.Name.ToString().ToLowerInvariant()) diff --git a/Subsurface/Source/Map/MapEntityPrefab.cs b/Subsurface/Source/Map/MapEntityPrefab.cs index 9669bd545..5d357841d 100644 --- a/Subsurface/Source/Map/MapEntityPrefab.cs +++ b/Subsurface/Source/Map/MapEntityPrefab.cs @@ -18,7 +18,9 @@ namespace Barotrauma public static List list = new List(); protected string name; - + + public List tags; + protected bool isLinkable; public Sprite sprite; diff --git a/Subsurface/Source/Networking/GameServerSettings.cs b/Subsurface/Source/Networking/GameServerSettings.cs index 0a9ad41b0..6ecf872fc 100644 --- a/Subsurface/Source/Networking/GameServerSettings.cs +++ b/Subsurface/Source/Networking/GameServerSettings.cs @@ -503,10 +503,14 @@ namespace Barotrauma.Networking return true; }; + var allitems = new List(); foreach (MapEntityCategory category in Enum.GetValues(typeof(MapEntityCategory))) { if (category == MapEntityCategory.Machine || category == MapEntityCategory.Structure) continue; - var items = MapEntityPrefab.list.FindAll(ep => ep.Price > 0.0f && ep.Category.HasFlag(category)); + var items = MapEntityPrefab.list.FindAll(ep => ep is ItemPrefab && (ep.Price > 0.0f || ep.tags.Contains("smallitem")) && ep.Category.HasFlag(category)); + DebugConsole.NewMessage(category.ToString() + " " + items.Count.ToString(), Color.Lime); + items.RemoveAll(ep => allitems.Contains(ep)); + allitems.AddRange(items); foreach (MapEntityPrefab pf in items) { GUITextBlock textBlock = new GUITextBlock(