Update for collision events by-ref (#10933)

This commit is contained in:
metalgearsloth
2022-09-14 17:26:26 +10:00
committed by GitHub
parent feb50ce7cc
commit 78a4ab6eb2
105 changed files with 204 additions and 62 deletions

View File

@@ -13,6 +13,9 @@ using System.Linq;
using Content.Shared.Tag;
using Content.Shared.Tools.Components;
using Content.Shared.Verbs;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Systems;
namespace Content.Shared.Doors.Systems;
@@ -447,15 +450,15 @@ public abstract class SharedDoorSystem : EntitySystem
}
}
private void PreventCollision(EntityUid uid, DoorComponent component, PreventCollideEvent args)
private void PreventCollision(EntityUid uid, DoorComponent component, ref PreventCollideEvent args)
{
if (component.CurrentlyCrushing.Contains(args.BodyB.Owner))
{
args.Cancel();
args.Cancelled = true;
}
}
protected virtual void HandleCollide(EntityUid uid, DoorComponent door, StartCollideEvent args)
protected virtual void HandleCollide(EntityUid uid, DoorComponent door, ref StartCollideEvent args)
{
// TODO ACCESS READER move access reader to shared and predict door opening/closing
// Then this can be moved to the shared system without mispredicting.