Improve InteractionSystem range & BUI checks (#27999)

* Improve InteractionSystem range & BUI checks

* Ghost fixes

* AAA

* Fix test

* fix nullable

* revert to broadcast event

* Fixes for eengine PR

* Ah buckle code

* )
This commit is contained in:
Leon Friedrich
2024-05-24 17:03:03 +12:00
committed by GitHub
parent 01e7c9c37e
commit 76e13eed35
18 changed files with 232 additions and 248 deletions

View File

@@ -362,14 +362,17 @@ public sealed class PullingSystem : EntitySystem
return !startPull.Cancelled && !getPulled.Cancelled;
}
public bool TogglePull(EntityUid pullableUid, EntityUid pullerUid, PullableComponent pullable)
public bool TogglePull(Entity<PullableComponent?> pullable, EntityUid pullerUid)
{
if (pullable.Puller == pullerUid)
if (!Resolve(pullable, ref pullable.Comp, false))
return false;
if (pullable.Comp.Puller == pullerUid)
{
return TryStopPull(pullableUid, pullable);
return TryStopPull(pullable, pullable.Comp);
}
return TryStartPull(pullerUid, pullableUid, pullableComp: pullable);
return TryStartPull(pullerUid, pullable, pullableComp: pullable);
}
public bool TogglePull(EntityUid pullerUid, PullerComponent puller)
@@ -377,7 +380,7 @@ public sealed class PullingSystem : EntitySystem
if (!TryComp<PullableComponent>(puller.Pulling, out var pullable))
return false;
return TogglePull(puller.Pulling.Value, pullerUid, pullable);
return TogglePull((puller.Pulling.Value, pullable), pullerUid);
}
public bool TryStartPull(EntityUid pullerUid, EntityUid pullableUid,