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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -81,6 +81,7 @@ namespace Content.Client
prototypes.RegisterIgnore("objective");
prototypes.RegisterIgnore("holiday");
prototypes.RegisterIgnore("aiFaction");
prototypes.RegisterIgnore("behaviorSet");
ClientContentIoC.Register();

View file

@ -1,3 +1,4 @@
#nullable enable
using System.Collections.Generic;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@ -11,16 +12,17 @@ namespace Content.Server.AI.Utility
/// <summary>
/// Name of the BehaviorSet.
/// </summary>
public string ID { get; private set; }
public string ID { get; private set; } = default!;
/// <summary>
/// Actions that this BehaviorSet grants to the entity.
/// </summary>
public IReadOnlyList<string> Actions { get; private set; }
public IReadOnlyList<string> Actions { get; private set; } = default!;
public void LoadFrom(YamlMappingNode mapping)
{
var serializer = YamlObjectSerializer.NewReader(mapping);
serializer.DataField(this, x => x.ID, "id", string.Empty);
serializer.DataField(this, x => x.Actions, "actions", new List<string>());
}