InAir tweaks & chasm fixes (#19707)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Gravity;
|
||||
using Content.Shared.StepTrigger.Components;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Map.Components;
|
||||
@@ -10,6 +11,7 @@ namespace Content.Shared.StepTrigger.Systems;
|
||||
public sealed class StepTriggerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
|
||||
[Dependency] private readonly SharedGravitySystem _gravity = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -121,6 +123,13 @@ public sealed class StepTriggerSystem : EntitySystem
|
||||
if (!component.Active || component.CurrentlySteppedOn.Contains(otherUid))
|
||||
return false;
|
||||
|
||||
// Can't trigger if we don't ignore weightless entities
|
||||
// and the entity is flying or currently weightless
|
||||
// Makes sense simulation wise to have this be part of steptrigger directly IMO
|
||||
if (!component.IgnoreWeightless && TryComp<PhysicsComponent>(otherUid, out var physics) &&
|
||||
(physics.BodyStatus == BodyStatus.InAir || _gravity.IsWeightless(otherUid, physics)))
|
||||
return false;
|
||||
|
||||
var msg = new StepTriggerAttemptEvent { Source = uid, Tripper = otherUid };
|
||||
|
||||
RaiseLocalEvent(uid, ref msg, true);
|
||||
|
||||
Reference in New Issue
Block a user