Extracts magic strings from Tag calls (#36305)
* Extracts magic strings from Tag calls When #36281 gets merged, the `TagSystem` methods will all give warnings. Let's fix those warnings before they even happen! * Adds missing libraries * Remove not yet implemented TagSystem changes * Fix tag spelling error Genuinely surprised there was only 1! * Styling and proper type changes * Styling Co-authored-by: Tayrtahn <tayrtahn@gmail.com> --------- Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
@@ -14,6 +14,7 @@ using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Singularity.EntitySystems;
|
||||
@@ -36,6 +37,8 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
|
||||
[Dependency] private readonly TagSystem _tagSystem = default!;
|
||||
#endregion Dependencies
|
||||
|
||||
private static readonly ProtoId<TagPrototype> HighRiskItemTag = "HighRiskItem";
|
||||
|
||||
private EntityQuery<PhysicsComponent> _physicsQuery;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -127,7 +130,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
|
||||
return;
|
||||
|
||||
if (HasComp<MindContainerComponent>(morsel)
|
||||
|| _tagSystem.HasTag(morsel, "HighRiskItem")
|
||||
|| _tagSystem.HasTag(morsel, HighRiskItemTag)
|
||||
|| HasComp<ContainmentFieldGeneratorComponent>(morsel))
|
||||
{
|
||||
_adminLogger.Add(LogType.EntityDelete, LogImpact.High, $"{ToPrettyString(morsel):player} entered the event horizon of {ToPrettyString(hungry)} and was deleted");
|
||||
|
||||
Reference in New Issue
Block a user