diff --git a/Content.Shared/Cargo/CargoProductPrototype.cs b/Content.Shared/Cargo/CargoProductPrototype.cs index 65099c20f9..e3f29e4347 100644 --- a/Content.Shared/Cargo/CargoProductPrototype.cs +++ b/Content.Shared/Cargo/CargoProductPrototype.cs @@ -1,8 +1,10 @@ using System; +using Nett; using Robust.Shared.IoC; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; @@ -70,7 +72,7 @@ namespace Content.Shared.Cargo /// The prototype name of the product. /// [ViewVariables] - [DataField("product")] + [DataField("product", customTypeSerializer: typeof(PrototypeIdSerializer))] public string Product { get; } = string.Empty; /// diff --git a/Content.Shared/Cargo/Components/SharedGalacticMarketComponent.cs b/Content.Shared/Cargo/Components/SharedGalacticMarketComponent.cs index 166489fb3c..fba2fe46d9 100644 --- a/Content.Shared/Cargo/Components/SharedGalacticMarketComponent.cs +++ b/Content.Shared/Cargo/Components/SharedGalacticMarketComponent.cs @@ -4,9 +4,11 @@ using System.Collections.Generic; using Robust.Shared.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.IoC; +using Robust.Shared.Log; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; namespace Content.Shared.Cargo.Components { @@ -15,7 +17,7 @@ namespace Content.Shared.Cargo.Components { public sealed override string Name => "GalacticMarket"; - [DataField("products")] + [DataField("products", customTypeSerializer: typeof(PrototypeIdListSerializer))] protected List _productIds = new(); protected readonly List _products = new(); @@ -35,6 +37,7 @@ namespace Content.Shared.Cargo.Components { if (!prototypeManager.TryIndex(id, out CargoProductPrototype? product)) { + Logger.ErrorS("cargo", $"Unable to find {nameof(CargoProductPrototype)} for {id}"); continue; }