Inline OwnerUid

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 16:30:34 +01:00
parent 2eacf98335
commit f386b57148
85 changed files with 219 additions and 215 deletions

View File

@@ -45,7 +45,7 @@ namespace Content.Shared.Pulling.Systems
SharedPullerComponent component,
PullStartedMessage args)
{
if (args.Puller.OwnerUid != uid)
if (args.Puller.Owner != uid)
return;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
@@ -59,7 +59,7 @@ namespace Content.Shared.Pulling.Systems
SharedPullerComponent component,
PullStoppedMessage args)
{
if (args.Puller.OwnerUid != uid)
if (args.Puller.Owner != uid)
return;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
@@ -75,7 +75,7 @@ namespace Content.Shared.Pulling.Systems
private void RefreshMovementSpeed(SharedPullerComponent component)
{
_movementSpeedModifierSystem.RefreshMovementSpeedModifiers(component.OwnerUid);
_movementSpeedModifierSystem.RefreshMovementSpeedModifiers(((IComponent) component).Owner);
}
}
}

View File

@@ -59,10 +59,10 @@ namespace Content.Shared.Pulling
// Messaging
var message = new PullStoppedMessage(pullerPhysics, pullablePhysics);
RaiseLocalEvent(puller.OwnerUid, message, broadcast: false);
RaiseLocalEvent(((IComponent) puller).Owner, message, broadcast: false);
if ((!IoCManager.Resolve<IEntityManager>().EntityExists(pullable.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pullable.Owner).EntityLifeStage) <= EntityLifeStage.MapInitialized)
RaiseLocalEvent(pullable.OwnerUid, message);
RaiseLocalEvent(((IComponent) pullable).Owner, message);
// Networking
puller.Dirty();
@@ -106,7 +106,7 @@ namespace Content.Shared.Pulling
var union = pullerPhysics.GetWorldAABB().Union(pullablePhysics.GetWorldAABB());
var length = Math.Max(union.Size.X, union.Size.Y) * 0.75f;
pullable.PullJoint = _jointSystem.CreateDistanceJoint(pullablePhysics.OwnerUid, pullerPhysics.Owner, id:$"pull-joint-{pullablePhysics.Owner}");
pullable.PullJoint = _jointSystem.CreateDistanceJoint(((IComponent) pullablePhysics).Owner, pullerPhysics.Owner, id:$"pull-joint-{pullablePhysics.Owner}");
pullable.PullJoint.CollideConnected = false;
// This maximum has to be there because if the object is constrained too closely, the clamping goes backwards and asserts.
pullable.PullJoint.MaxLength = Math.Max(1.0f, length);
@@ -117,8 +117,8 @@ namespace Content.Shared.Pulling
// Messaging
var message = new PullStartedMessage(pullerPhysics, pullablePhysics);
RaiseLocalEvent(puller.OwnerUid, message, broadcast: false);
RaiseLocalEvent(pullable.OwnerUid, message);
RaiseLocalEvent(((IComponent) puller).Owner, message, broadcast: false);
RaiseLocalEvent(((IComponent) pullable).Owner, message);
// Networking
puller.Dirty();

View File

@@ -92,7 +92,7 @@ namespace Content.Shared.Pulling
}
var msg = new StopPullingEvent(user);
RaiseLocalEvent(pullable.OwnerUid, msg);
RaiseLocalEvent(((IComponent) pullable).Owner, msg);
if (msg.Cancelled) return false;
@@ -173,14 +173,14 @@ namespace Content.Shared.Pulling
var pullAttempt = new PullAttemptMessage(pullerPhysics, pullablePhysics);
RaiseLocalEvent(puller.OwnerUid, pullAttempt, broadcast: false);
RaiseLocalEvent(((IComponent) puller).Owner, pullAttempt, broadcast: false);
if (pullAttempt.Cancelled)
{
return false;
}
RaiseLocalEvent(pullable.OwnerUid, pullAttempt);
RaiseLocalEvent(((IComponent) pullable).Owner, pullAttempt);
if (pullAttempt.Cancelled)
{

View File

@@ -102,7 +102,7 @@ namespace Content.Shared.Pulling
// Raise a "you are being pulled" alert if the pulled entity has alerts.
private static void PullableHandlePullStarted(EntityUid uid, SharedPullableComponent component, PullStartedMessage args)
{
if (args.Pulled.OwnerUid != uid)
if (args.Pulled.Owner != uid)
return;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))
@@ -111,7 +111,7 @@ namespace Content.Shared.Pulling
private static void PullableHandlePullStopped(EntityUid uid, SharedPullableComponent component, PullStoppedMessage args)
{
if (args.Pulled.OwnerUid != uid)
if (args.Pulled.Owner != uid)
return;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts))