Fixes Borgs and Syndicats getting hurt by glass shards and other things + honkbot slipping 2 (#31011)
* Lets do this again * I noticed this way to late
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.StepTrigger.Components;
|
||||
using Content.Shared.Tag;
|
||||
|
||||
namespace Content.Shared.StepTrigger.Systems;
|
||||
|
||||
@@ -12,25 +11,19 @@ public sealed class StepTriggerImmuneSystem : EntitySystem
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<StepTriggerImmuneComponent, StepTriggerAttemptEvent>(OnStepTriggerAttempt);
|
||||
SubscribeLocalEvent<ClothingRequiredStepTriggerComponent, StepTriggerAttemptEvent>(OnStepTriggerClothingAttempt);
|
||||
SubscribeLocalEvent<ClothingRequiredStepTriggerComponent, ExaminedEvent>(OnExamined);
|
||||
SubscribeLocalEvent<PreventableStepTriggerComponent, StepTriggerAttemptEvent>(OnStepTriggerClothingAttempt);
|
||||
SubscribeLocalEvent<PreventableStepTriggerComponent, ExaminedEvent>(OnExamined);
|
||||
}
|
||||
|
||||
private void OnStepTriggerAttempt(Entity<StepTriggerImmuneComponent> ent, ref StepTriggerAttemptEvent args)
|
||||
private void OnStepTriggerClothingAttempt(Entity<PreventableStepTriggerComponent> ent, ref StepTriggerAttemptEvent args)
|
||||
{
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnStepTriggerClothingAttempt(EntityUid uid, ClothingRequiredStepTriggerComponent component, ref StepTriggerAttemptEvent args)
|
||||
{
|
||||
if (_inventory.TryGetInventoryEntity<ClothingRequiredStepTriggerImmuneComponent>(args.Tripper, out _))
|
||||
if (HasComp<ProtectedFromStepTriggersComponent>(args.Tripper) || _inventory.TryGetInventoryEntity<ProtectedFromStepTriggersComponent>(args.Tripper, out _))
|
||||
{
|
||||
args.Cancelled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnExamined(EntityUid uid, ClothingRequiredStepTriggerComponent component, ExaminedEvent args)
|
||||
private void OnExamined(EntityUid uid, PreventableStepTriggerComponent component, ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("clothing-required-step-trigger-examine"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user