Fix behaviorSet prototype error (#3407)

This commit is contained in:
AJCM-git
2021-02-24 20:09:27 -04:00
committed by GitHub
parent 436d406585
commit fc5d6452cd
2 changed files with 5 additions and 2 deletions

View File

@@ -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();

View File

@@ -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>());
} }