Add EntityUid fields to some physics events (#17055)
This commit is contained in:
@@ -390,7 +390,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
|
|||||||
if (base.PreventCollide(uid, comp, ref args) || args.Cancelled)
|
if (base.PreventCollide(uid, comp, ref args) || args.Cancelled)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
args.Cancelled = !CanConsumeEntity(args.BodyB.Owner, comp);
|
args.Cancelled = !CanConsumeEntity(args.OtherEntity, comp);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public abstract partial class SharedBuckleSystem
|
|||||||
|
|
||||||
private void OnBucklePreventCollide(EntityUid uid, BuckleComponent component, ref PreventCollideEvent args)
|
private void OnBucklePreventCollide(EntityUid uid, BuckleComponent component, ref PreventCollideEvent args)
|
||||||
{
|
{
|
||||||
if (args.BodyB.Owner != component.BuckledTo)
|
if (args.OtherEntity != component.BuckledTo)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (component.Buckled || component.DontCollide)
|
if (component.Buckled || component.DontCollide)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Content.Shared.Disposal
|
|||||||
private void OnPreventCollide(EntityUid uid, SharedDisposalUnitComponent component,
|
private void OnPreventCollide(EntityUid uid, SharedDisposalUnitComponent component,
|
||||||
ref PreventCollideEvent args)
|
ref PreventCollideEvent args)
|
||||||
{
|
{
|
||||||
var otherBody = args.BodyB.Owner;
|
var otherBody = args.OtherEntity;
|
||||||
|
|
||||||
// Items dropped shouldn't collide but items thrown should
|
// Items dropped shouldn't collide but items thrown should
|
||||||
if (EntityManager.HasComponent<ItemComponent>(otherBody) &&
|
if (EntityManager.HasComponent<ItemComponent>(otherBody) &&
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ public abstract class SharedDoorSystem : EntitySystem
|
|||||||
|
|
||||||
private void PreventCollision(EntityUid uid, DoorComponent component, ref PreventCollideEvent args)
|
private void PreventCollision(EntityUid uid, DoorComponent component, ref PreventCollideEvent args)
|
||||||
{
|
{
|
||||||
if (component.CurrentlyCrushing.Contains(args.BodyB.Owner))
|
if (component.CurrentlyCrushing.Contains(args.OtherEntity))
|
||||||
{
|
{
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,7 @@ public sealed class SharedPreventCollideSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnPreventCollide(EntityUid uid, PreventCollideComponent component, ref PreventCollideEvent args)
|
private void OnPreventCollide(EntityUid uid, PreventCollideComponent component, ref PreventCollideEvent args)
|
||||||
{
|
{
|
||||||
var otherUid = args.BodyB.Owner;
|
if (component.Uid == args.OtherEntity)
|
||||||
|
|
||||||
if (component.Uid == otherUid)
|
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace Content.Shared.Projectiles
|
|||||||
|
|
||||||
private void PreventCollision(EntityUid uid, ProjectileComponent component, ref PreventCollideEvent args)
|
private void PreventCollision(EntityUid uid, ProjectileComponent component, ref PreventCollideEvent args)
|
||||||
{
|
{
|
||||||
if (component.IgnoreShooter && args.BodyB.Owner == component.Shooter)
|
if (component.IgnoreShooter && args.OtherEntity == component.Shooter)
|
||||||
{
|
{
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ namespace Content.Shared.Pulling
|
|||||||
|
|
||||||
private void OnJointRemoved(EntityUid uid, SharedPullableComponent component, JointRemovedEvent args)
|
private void OnJointRemoved(EntityUid uid, SharedPullableComponent component, JointRemovedEvent args)
|
||||||
{
|
{
|
||||||
if (component.Puller != args.OtherBody.Owner)
|
if (component.Puller != args.OtherEntity)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Do we have some other join with our Puller?
|
// Do we have some other join with our Puller?
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public abstract class SharedEventHorizonSystem : EntitySystem
|
|||||||
/// <returns>A bool indicating whether the collision prevention has been handled.</returns>
|
/// <returns>A bool indicating whether the collision prevention has been handled.</returns>
|
||||||
protected virtual bool PreventCollide(EntityUid uid, EventHorizonComponent comp, ref PreventCollideEvent args)
|
protected virtual bool PreventCollide(EntityUid uid, EventHorizonComponent comp, ref PreventCollideEvent args)
|
||||||
{
|
{
|
||||||
var otherUid = args.BodyB.Owner;
|
var otherUid = args.OtherEntity;
|
||||||
|
|
||||||
// For prediction reasons always want the client to ignore these.
|
// For prediction reasons always want the client to ignore these.
|
||||||
if (HasComp<MapGridComponent>(otherUid) ||
|
if (HasComp<MapGridComponent>(otherUid) ||
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ namespace Content.Shared.Throwing
|
|||||||
|
|
||||||
private void PreventCollision(EntityUid uid, ThrownItemComponent component, ref PreventCollideEvent args)
|
private void PreventCollision(EntityUid uid, ThrownItemComponent component, ref PreventCollideEvent args)
|
||||||
{
|
{
|
||||||
if (args.BodyB.Owner == component.Thrower)
|
if (args.OtherEntity == component.Thrower)
|
||||||
{
|
{
|
||||||
args.Cancelled = true;
|
args.Cancelled = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user