Hotfix VisualizerDataInt (#13920)
Fixes https://github.com/space-wizards/space-station-14/issues/13919
This commit is contained in:
@@ -8,22 +8,21 @@ namespace Content.Server.Construction.Completions
|
|||||||
{
|
{
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
[DataDefinition]
|
[DataDefinition]
|
||||||
public sealed class VisualizerDataInt : IGraphAction, ISerializationHooks
|
public sealed class VisualizerDataInt : IGraphAction
|
||||||
{
|
{
|
||||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
|
||||||
|
|
||||||
[DataField("key")] public string Key { get; private set; } = string.Empty;
|
[DataField("key")] public string Key { get; private set; } = string.Empty;
|
||||||
[DataField("data")] public int Data { get; private set; } = 0;
|
[DataField("data")] public int Data { get; private set; } = 0;
|
||||||
|
|
||||||
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
|
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Key)) return;
|
if (string.IsNullOrEmpty(Key))
|
||||||
|
return;
|
||||||
|
|
||||||
if (entityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
if (entityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||||
{
|
{
|
||||||
if (IoCManager.Resolve<IReflectionManager>().TryParseEnumReference(Key, out var @enum))
|
if (IoCManager.Resolve<IReflectionManager>().TryParseEnumReference(Key, out var @enum))
|
||||||
{
|
{
|
||||||
_appearance.SetData(uid, @enum, Data, appearance);
|
entityManager.System<AppearanceSystem>().SetData(uid, @enum, Data, appearance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user