Fix behaviorSet prototype error (#3407)
This commit is contained in:
@@ -81,6 +81,7 @@ namespace Content.Client
|
|||||||
prototypes.RegisterIgnore("objective");
|
prototypes.RegisterIgnore("objective");
|
||||||
prototypes.RegisterIgnore("holiday");
|
prototypes.RegisterIgnore("holiday");
|
||||||
prototypes.RegisterIgnore("aiFaction");
|
prototypes.RegisterIgnore("aiFaction");
|
||||||
|
prototypes.RegisterIgnore("behaviorSet");
|
||||||
|
|
||||||
ClientContentIoC.Register();
|
ClientContentIoC.Register();
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#nullable enable
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
@@ -11,16 +12,17 @@ namespace Content.Server.AI.Utility
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name of the BehaviorSet.
|
/// Name of the BehaviorSet.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ID { get; private set; }
|
public string ID { get; private set; } = default!;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Actions that this BehaviorSet grants to the entity.
|
/// Actions that this BehaviorSet grants to the entity.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IReadOnlyList<string> Actions { get; private set; }
|
public IReadOnlyList<string> Actions { get; private set; } = default!;
|
||||||
|
|
||||||
public void LoadFrom(YamlMappingNode mapping)
|
public void LoadFrom(YamlMappingNode mapping)
|
||||||
{
|
{
|
||||||
var serializer = YamlObjectSerializer.NewReader(mapping);
|
var serializer = YamlObjectSerializer.NewReader(mapping);
|
||||||
|
|
||||||
serializer.DataField(this, x => x.ID, "id", string.Empty);
|
serializer.DataField(this, x => x.ID, "id", string.Empty);
|
||||||
serializer.DataField(this, x => x.Actions, "actions", new List<string>());
|
serializer.DataField(this, x => x.Actions, "actions", new List<string>());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user