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:
Verm
2024-09-11 05:12:08 +03:00
committed by Spatison
parent 4edcd9b237
commit f31d74c046
29 changed files with 182 additions and 211 deletions

View File

@@ -125,14 +125,7 @@ public sealed class StepTriggerSystem : EntitySystem
private bool CanTrigger(EntityUid uid, EntityUid otherUid, StepTriggerComponent component)
{
if (!component.Active
|| component.CurrentlySteppedOn.Contains(otherUid))
return false;
// Immunity checks
if (TryComp<StepTriggerImmuneComponent>(otherUid, out var stepTriggerImmuneComponent)
&& component.TriggerGroups != null
&& component.TriggerGroups.IsValid(stepTriggerImmuneComponent))
if (!component.Active || component.CurrentlySteppedOn.Contains(otherUid))
return false;
// Can't trigger if we don't ignore weightless entities
@@ -142,7 +135,7 @@ public sealed class StepTriggerSystem : EntitySystem
(physics.BodyStatus == BodyStatus.InAir || _gravity.IsWeightless(otherUid, physics)))
return false;
var msg = new StepTriggerAttemptEvent { Source = uid, Tripper = otherUid };
var msg = new StepTriggerAttemptEvent { Source = (uid, component), Tripper = otherUid };
RaiseLocalEvent(uid, ref msg);
return msg.Continue && !msg.Cancelled;
@@ -226,7 +219,7 @@ public sealed class StepTriggerSystem : EntitySystem
/// Allows for entities to end the steptrigger early via args.Cancelled.
/// </summary>
[ByRefEvent]
public record struct StepTriggerAttemptEvent(EntityUid Source, EntityUid Tripper, bool Continue, bool Cancelled);
public record struct StepTriggerAttemptEvent(Entity<StepTriggerComponent> Source, EntityUid Tripper, bool Continue, bool Cancelled);
/// <summary>
/// Raised when an entity stands on a steptrigger initially (assuming it has both on and off states).