Fix warnings and code cleanup/fixes (#13570)
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Content.Shared.Actions.ActionTypes;
|
||||
[Prototype("worldTargetAction")]
|
||||
public sealed class WorldTargetActionPrototype : WorldTargetAction, IPrototype
|
||||
{
|
||||
[IdDataFieldAttribute]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
// This is a shitty hack to get around the fact that action-prototypes should not in general be sever-exclusive
|
||||
@@ -29,7 +29,7 @@ public sealed class WorldTargetActionPrototype : WorldTargetAction, IPrototype
|
||||
[Prototype("entityTargetAction")]
|
||||
public sealed class EntityTargetActionPrototype : EntityTargetAction, IPrototype
|
||||
{
|
||||
[IdDataFieldAttribute]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("serverEvent", serverOnly: true)]
|
||||
@@ -43,7 +43,7 @@ public sealed class EntityTargetActionPrototype : EntityTargetAction, IPrototype
|
||||
[Prototype("instantAction")]
|
||||
public sealed class InstantActionPrototype : InstantAction, IPrototype
|
||||
{
|
||||
[IdDataFieldAttribute]
|
||||
[IdDataField]
|
||||
public string ID { get; } = default!;
|
||||
|
||||
[DataField("serverEvent", serverOnly: true)]
|
||||
|
||||
@@ -128,7 +128,7 @@ public abstract class SharedActionsSystem : EntitySystem
|
||||
{
|
||||
case EntityTargetAction entityAction:
|
||||
|
||||
if (ev.EntityTarget is not EntityUid { Valid: true } entityTarget)
|
||||
if (ev.EntityTarget is not { Valid: true } entityTarget)
|
||||
{
|
||||
Logger.Error($"Attempted to perform an entity-targeted action without a target! Action: {entityAction.DisplayName}");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user