Update for collision events by-ref (#10933)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user