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

@@ -7,6 +7,7 @@ using Content.Shared.Throwing;
using JetBrains.Annotations;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Physics.Events;
using Robust.Shared.Timing;
namespace Content.Shared.Disposal
@@ -28,7 +29,7 @@ namespace Content.Shared.Disposal
SubscribeLocalEvent<SharedDisposalUnitComponent, CanDragDropOnEvent>(OnCanDragDropOn);
}
private void OnPreventCollide(EntityUid uid, SharedDisposalUnitComponent component, PreventCollideEvent args)
private void OnPreventCollide(EntityUid uid, SharedDisposalUnitComponent component, ref PreventCollideEvent args)
{
var otherBody = args.BodyB.Owner;
@@ -36,13 +37,13 @@ namespace Content.Shared.Disposal
if (EntityManager.HasComponent<ItemComponent>(otherBody) &&
!EntityManager.HasComponent<ThrownItemComponent>(otherBody))
{
args.Cancel();
args.Cancelled = true;
return;
}
if (component.RecentlyEjected.Contains(otherBody))
{
args.Cancel();
args.Cancelled = true;
}
}