Code cleanup: Purge obsoleted SharedPhysicsSystem methods (#26287)
Updated calls to SharedPhysicsSystem methods
This commit is contained in:
@@ -74,7 +74,7 @@ public sealed class MeleeThrowOnHitSystem : EntitySystem
|
||||
comp.PreviousStatus = body.BodyStatus;
|
||||
comp.ThrownEndTime = _timing.CurTime + TimeSpan.FromSeconds(comp.Lifetime);
|
||||
comp.MinLifetimeTime = _timing.CurTime + TimeSpan.FromSeconds(comp.MinLifetime);
|
||||
_physics.SetBodyStatus(body, BodyStatus.InAir);
|
||||
_physics.SetBodyStatus(ent, body, BodyStatus.InAir);
|
||||
_physics.SetLinearVelocity(ent, Vector2.Zero, body: body);
|
||||
_physics.ApplyLinearImpulse(ent, comp.Velocity * body.Mass, body: body);
|
||||
Dirty(ent, ent.Comp);
|
||||
@@ -83,7 +83,7 @@ public sealed class MeleeThrowOnHitSystem : EntitySystem
|
||||
private void OnThrownShutdown(Entity<MeleeThrownComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
if (TryComp<PhysicsComponent>(ent, out var body))
|
||||
_physics.SetBodyStatus(body,ent.Comp.PreviousStatus);
|
||||
_physics.SetBodyStatus(ent, body, ent.Comp.PreviousStatus);
|
||||
var ev = new MeleeThrowOnHitEndEvent();
|
||||
RaiseLocalEvent(ent, ref ev);
|
||||
}
|
||||
|
||||
@@ -207,12 +207,12 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
|
||||
TransformSystem.Unanchor(target, targetXform);
|
||||
component.Tethered = target;
|
||||
var tethered = EnsureComp<TetheredComponent>(target);
|
||||
_physics.SetBodyStatus(targetPhysics, BodyStatus.InAir, false);
|
||||
_physics.SetBodyStatus(target, targetPhysics, BodyStatus.InAir, false);
|
||||
_physics.SetSleepingAllowed(target, targetPhysics, false);
|
||||
tethered.Tetherer = gunUid;
|
||||
tethered.OriginalAngularDamping = targetPhysics.AngularDamping;
|
||||
_physics.SetAngularDamping(targetPhysics, 0f);
|
||||
_physics.SetLinearDamping(targetPhysics, 0f);
|
||||
_physics.SetAngularDamping(target, targetPhysics, 0f);
|
||||
_physics.SetLinearDamping(target, targetPhysics, 0f);
|
||||
_physics.SetAngularVelocity(target, SpinVelocity, body: targetPhysics);
|
||||
_physics.WakeBody(target, body: targetPhysics);
|
||||
var thrown = EnsureComp<ThrownItemComponent>(component.Tethered.Value);
|
||||
@@ -264,9 +264,9 @@ public abstract partial class SharedTetherGunSystem : EntitySystem
|
||||
_thrown.StopThrow(component.Tethered.Value, thrown);
|
||||
}
|
||||
|
||||
_physics.SetBodyStatus(targetPhysics, BodyStatus.OnGround);
|
||||
_physics.SetBodyStatus(component.Tethered.Value, targetPhysics, BodyStatus.OnGround);
|
||||
_physics.SetSleepingAllowed(component.Tethered.Value, targetPhysics, true);
|
||||
_physics.SetAngularDamping(targetPhysics, Comp<TetheredComponent>(component.Tethered.Value).OriginalAngularDamping);
|
||||
_physics.SetAngularDamping(component.Tethered.Value, targetPhysics, Comp<TetheredComponent>(component.Tethered.Value).OriginalAngularDamping);
|
||||
}
|
||||
|
||||
if (!transfer)
|
||||
|
||||
@@ -386,7 +386,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||
public void ShootProjectile(EntityUid uid, Vector2 direction, Vector2 gunVelocity, EntityUid gunUid, EntityUid? user = null, float speed = 20f)
|
||||
{
|
||||
var physics = EnsureComp<PhysicsComponent>(uid);
|
||||
Physics.SetBodyStatus(physics, BodyStatus.InAir);
|
||||
Physics.SetBodyStatus(uid, physics, BodyStatus.InAir);
|
||||
|
||||
var targetMapVelocity = gunVelocity + direction.Normalized() * speed;
|
||||
var currentMapVelocity = Physics.GetMapLinearVelocity(uid, physics);
|
||||
|
||||
Reference in New Issue
Block a user