From 810a1ead1c6d1e27e754921e734ed0de07925907 Mon Sep 17 00:00:00 2001 From: Tayrtahn Date: Wed, 20 Mar 2024 09:09:29 -0400 Subject: [PATCH] Updated calls to SharedPhysicsSystem methods --- .../Administration/Systems/AdminVerbSystem.Smites.cs | 12 ++++++------ .../AtmosphereSystem.HighPressureDelta.cs | 8 ++++---- .../Chemistry/EntitySystems/VaporSystem.cs | 4 ++-- Content.Server/ImmovableRod/ImmovableRodSystem.cs | 6 +++--- .../ParticleAcceleratorSystem.Emitter.cs | 2 +- .../Physics/Controllers/ChasingWalkSystem.cs | 2 +- .../Systems/ShuttleSystem.FasterThanLight.cs | 8 ++++---- Content.Server/Shuttles/Systems/ShuttleSystem.cs | 8 ++++---- .../StationEvents/Events/MeteorSwarmRule.cs | 6 +++--- Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs | 2 +- .../Movement/Systems/SharedJetpackSystem.cs | 4 ++-- Content.Shared/Throwing/ThrowingSystem.cs | 6 +++--- Content.Shared/Throwing/ThrownItemSystem.cs | 2 +- .../Weapons/Melee/MeleeThrowOnHitSystem.cs | 4 ++-- Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs | 10 +++++----- .../Weapons/Ranged/Systems/SharedGunSystem.cs | 2 +- 16 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index 1047b4c9debfcd..942882f7aef429 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -409,7 +409,7 @@ private void AddSmiteVerbs(GetVerbsEvent args) var fixtures = Comp(args.Target); xform.Anchored = false; // Just in case. _physics.SetBodyType(args.Target, BodyType.Dynamic, manager: fixtures, body: physics); - _physics.SetBodyStatus(physics, BodyStatus.InAir); + _physics.SetBodyStatus(args.Target, physics, BodyStatus.InAir); _physics.WakeBody(args.Target, manager: fixtures, body: physics); foreach (var fixture in fixtures.Fixtures.Values) @@ -424,8 +424,8 @@ private void AddSmiteVerbs(GetVerbsEvent args) _physics.SetLinearVelocity(args.Target, _random.NextVector2(1.5f, 1.5f), manager: fixtures, body: physics); _physics.SetAngularVelocity(args.Target, MathF.PI * 12, manager: fixtures, body: physics); - _physics.SetLinearDamping(physics, 0f); - _physics.SetAngularDamping(physics, 0f); + _physics.SetLinearDamping(args.Target, physics, 0f); + _physics.SetAngularDamping(args.Target, physics, 0f); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-pinball-description") @@ -444,7 +444,7 @@ private void AddSmiteVerbs(GetVerbsEvent args) xform.Anchored = false; // Just in case. _physics.SetBodyType(args.Target, BodyType.Dynamic, body: physics); - _physics.SetBodyStatus(physics, BodyStatus.InAir); + _physics.SetBodyStatus(args.Target, physics, BodyStatus.InAir); _physics.WakeBody(args.Target, manager: fixtures, body: physics); foreach (var fixture in fixtures.Fixtures.Values) @@ -454,8 +454,8 @@ private void AddSmiteVerbs(GetVerbsEvent args) _physics.SetLinearVelocity(args.Target, _random.NextVector2(8.0f, 8.0f), manager: fixtures, body: physics); _physics.SetAngularVelocity(args.Target, MathF.PI * 12, manager: fixtures, body: physics); - _physics.SetLinearDamping(physics, 0f); - _physics.SetAngularDamping(physics, 0f); + _physics.SetLinearDamping(args.Target, physics, 0f); + _physics.SetAngularDamping(args.Target, physics, 0f); }, Impact = LogImpact.Extreme, Message = Loc.GetString("admin-smite-yeet-description") diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs index 53035e1ed3c555..346a3af089c1fa 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs @@ -54,7 +54,7 @@ private void UpdateHighPressure(float frameTime) if (HasComp(uid) && TryComp(uid, out var body)) { - _physics.SetBodyStatus(body, BodyStatus.OnGround); + _physics.SetBodyStatus(uid, body, BodyStatus.OnGround); } if (TryComp(uid, out var fixtures)) @@ -77,7 +77,7 @@ private void AddMobMovedByPressure(EntityUid uid, MovedByPressureComponent compo if (!TryComp(uid, out var fixtures)) return; - _physics.SetBodyStatus(body, BodyStatus.InAir); + _physics.SetBodyStatus(uid, body, BodyStatus.InAir); foreach (var (id, fixture) in fixtures.Fixtures) { @@ -96,9 +96,9 @@ private void HighPressureMovements(Entity gridAtmospher // TODO ATMOS finish this // Don't play the space wind sound on tiles that are on fire... - if(tile.PressureDifference > 15 && !tile.Hotspot.Valid) + if (tile.PressureDifference > 15 && !tile.Hotspot.Valid) { - if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound)) + if (_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound)) { var coordinates = _mapSystem.ToCenterCoordinates(tile.GridIndex, tile.GridIndices); _audio.PlayPvs(SpaceWindSound, coordinates, AudioParams.Default.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100))); diff --git a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs index d945c1f818b722..7d3f70bc0d8926 100644 --- a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs @@ -64,8 +64,8 @@ public void Start(Entity vapor, TransformComponent vaporXform, V // Set Move if (EntityManager.TryGetComponent(vapor, out PhysicsComponent? physics)) { - _physics.SetLinearDamping(physics, 0f); - _physics.SetAngularDamping(physics, 0f); + _physics.SetLinearDamping(vapor, physics, 0f); + _physics.SetAngularDamping(vapor, physics, 0f); _throwing.TryThrow(vapor, dir, speed, user: user); diff --git a/Content.Server/ImmovableRod/ImmovableRodSystem.cs b/Content.Server/ImmovableRod/ImmovableRodSystem.cs index 0fa8f7d292f2cd..31aa39cf03a870 100644 --- a/Content.Server/ImmovableRod/ImmovableRodSystem.cs +++ b/Content.Server/ImmovableRod/ImmovableRodSystem.cs @@ -53,9 +53,9 @@ private void OnMapInit(EntityUid uid, ImmovableRodComponent component, MapInitEv { if (EntityManager.TryGetComponent(uid, out PhysicsComponent? phys)) { - _physics.SetLinearDamping(phys, 0f); - _physics.SetFriction(phys, 0f); - _physics.SetBodyStatus(phys, BodyStatus.InAir); + _physics.SetLinearDamping(uid, phys, 0f); + _physics.SetFriction(uid, phys, 0f); + _physics.SetBodyStatus(uid, phys, BodyStatus.InAir); if (!component.RandomizeVelocity) return; diff --git a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Emitter.cs b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Emitter.cs index 46b25163cc02e3..06f1b6b154c56b 100644 --- a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Emitter.cs +++ b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Emitter.cs @@ -28,7 +28,7 @@ private void FireEmitter(EntityUid uid, ParticleAcceleratorPowerState strength, if (TryComp(emitted, out var particlePhys)) { var angle = _transformSystem.GetWorldRotation(uid, xformQuery); - _physicsSystem.SetBodyStatus(particlePhys, BodyStatus.InAir); + _physicsSystem.SetBodyStatus(emitted, particlePhys, BodyStatus.InAir); var velocity = angle.ToWorldVec() * 20f; if (TryComp(uid, out var phys)) diff --git a/Content.Server/Physics/Controllers/ChasingWalkSystem.cs b/Content.Server/Physics/Controllers/ChasingWalkSystem.cs index 215e7e3124e877..618dd4156fc03a 100644 --- a/Content.Server/Physics/Controllers/ChasingWalkSystem.cs +++ b/Content.Server/Physics/Controllers/ChasingWalkSystem.cs @@ -97,6 +97,6 @@ private void ForceImpulse(EntityUid uid, ChasingWalkComponent component) var speed = delta.Length() > 0 ? delta.Normalized() * component.Speed : Vector2.Zero; _physics.SetLinearVelocity(uid, speed); - _physics.SetBodyStatus(physics, BodyStatus.InAir); //If this is not done, from the explosion up close, the tesla will "Fall" to the ground, and almost stop moving. + _physics.SetBodyStatus(uid, physics, BodyStatus.InAir); //If this is not done, from the explosion up close, the tesla will "Fall" to the ground, and almost stop moving. } } diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index f9ceab8f7b107a..e4e4534b0c5805 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -371,8 +371,8 @@ private void UpdateFTLStarting(Entity entity) Enable(uid, component: body); _physics.SetLinearVelocity(uid, new Vector2(0f, 20f), body: body); _physics.SetAngularVelocity(uid, 0f, body: body); - _physics.SetLinearDamping(body, 0f); - _physics.SetAngularDamping(body, 0f); + _physics.SetLinearDamping(uid, body, 0f); + _physics.SetAngularDamping(uid, body, 0f); _dockSystem.SetDockBolts(uid, true); _console.RefreshShuttleConsoles(uid); @@ -426,8 +426,8 @@ private void UpdateFTLArriving(Entity entity) _physics.SetLinearVelocity(uid, Vector2.Zero, body: body); _physics.SetAngularVelocity(uid, 0f, body: body); - _physics.SetLinearDamping(body, entity.Comp2.LinearDamping); - _physics.SetAngularDamping(body, entity.Comp2.AngularDamping); + _physics.SetLinearDamping(uid, body, entity.Comp2.LinearDamping); + _physics.SetAngularDamping(uid, body, entity.Comp2.AngularDamping); var target = entity.Comp1.TargetCoordinates; diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.cs index 8d44dae4b2e5d5..7c42753a7de9dd 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.cs @@ -129,10 +129,10 @@ public void Enable(EntityUid uid, FixturesComponent? manager = null, PhysicsComp return; _physics.SetBodyType(uid, BodyType.Dynamic, manager: manager, body: component); - _physics.SetBodyStatus(component, BodyStatus.InAir); + _physics.SetBodyStatus(uid, component, BodyStatus.InAir); _physics.SetFixedRotation(uid, false, manager: manager, body: component); - _physics.SetLinearDamping(component, shuttle.LinearDamping); - _physics.SetAngularDamping(component, shuttle.AngularDamping); + _physics.SetLinearDamping(uid, component, shuttle.LinearDamping); + _physics.SetAngularDamping(uid, component, shuttle.AngularDamping); } public void Disable(EntityUid uid, FixturesComponent? manager = null, PhysicsComponent? component = null) @@ -141,7 +141,7 @@ public void Disable(EntityUid uid, FixturesComponent? manager = null, PhysicsCom return; _physics.SetBodyType(uid, BodyType.Static, manager: manager, body: component); - _physics.SetBodyStatus(component, BodyStatus.OnGround); + _physics.SetBodyStatus(uid, component, BodyStatus.OnGround); _physics.SetFixedRotation(uid, true, manager: manager, body: component); } diff --git a/Content.Server/StationEvents/Events/MeteorSwarmRule.cs b/Content.Server/StationEvents/Events/MeteorSwarmRule.cs index 192a620c9fcc17..ad56479b379dec 100644 --- a/Content.Server/StationEvents/Events/MeteorSwarmRule.cs +++ b/Content.Server/StationEvents/Events/MeteorSwarmRule.cs @@ -68,9 +68,9 @@ protected override void ActiveTick(EntityUid uid, MeteorSwarmRuleComponent compo var spawnPosition = new MapCoordinates(center + offset, mapId); var meteor = Spawn("MeteorLarge", spawnPosition); var physics = EntityManager.GetComponent(meteor); - _physics.SetBodyStatus(physics, BodyStatus.InAir); - _physics.SetLinearDamping(physics, 0f); - _physics.SetAngularDamping(physics, 0f); + _physics.SetBodyStatus(meteor, physics, BodyStatus.InAir); + _physics.SetLinearDamping(meteor, physics, 0f); + _physics.SetAngularDamping(meteor, physics, 0f); _physics.ApplyLinearImpulse(meteor, -offset.Normalized() * component.MeteorVelocity * physics.Mass, body: physics); _physics.ApplyAngularImpulse( meteor, diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index 70e816b16e4429..3d1fbf2b696244 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -358,7 +358,7 @@ public bool TryBuckle(EntityUid buckleUid, EntityUid userUid, EntityUid strapUid if (TryComp(buckleUid, out var physics)) { - _physics.ResetDynamics(physics); + _physics.ResetDynamics(buckleUid, physics); } if (!buckleComp.PullStrap && TryComp(strapUid, out var toPullable)) diff --git a/Content.Shared/Movement/Systems/SharedJetpackSystem.cs b/Content.Shared/Movement/Systems/SharedJetpackSystem.cs index abe12b79d1ab31..8c42511f8469c1 100644 --- a/Content.Shared/Movement/Systems/SharedJetpackSystem.cs +++ b/Content.Shared/Movement/Systems/SharedJetpackSystem.cs @@ -92,7 +92,7 @@ private void SetupUser(EntityUid user, EntityUid jetpackUid) _mover.SetRelay(user, jetpackUid); if (TryComp(user, out var physics)) - _physics.SetBodyStatus(physics, BodyStatus.InAir); + _physics.SetBodyStatus(user, physics, BodyStatus.InAir); userComp.Jetpack = jetpackUid; } @@ -103,7 +103,7 @@ private void RemoveUser(EntityUid uid) return; if (TryComp(uid, out var physics)) - _physics.SetBodyStatus(physics, BodyStatus.OnGround); + _physics.SetBodyStatus(uid, physics, BodyStatus.OnGround); RemComp(uid); } diff --git a/Content.Shared/Throwing/ThrowingSystem.cs b/Content.Shared/Throwing/ThrowingSystem.cs index 7c861a85adb0f7..38772eaf340ebe 100644 --- a/Content.Shared/Throwing/ThrowingSystem.cs +++ b/Content.Shared/Throwing/ThrowingSystem.cs @@ -174,7 +174,7 @@ public void TryThrow(EntityUid uid, } else { - _physics.SetBodyStatus(physics, BodyStatus.InAir); + _physics.SetBodyStatus(uid, physics, BodyStatus.InAir); } if (user == null) @@ -191,10 +191,10 @@ public void TryThrow(EntityUid uid, { var msg = new ThrowPushbackAttemptEvent(); RaiseLocalEvent(uid, msg); - const float MassLimit = 5f; + const float massLimit = 5f; if (!msg.Cancelled) - _physics.ApplyLinearImpulse(user.Value, -impulseVector / physics.Mass * pushbackRatio * MathF.Min(MassLimit, physics.Mass), body: userPhysics); + _physics.ApplyLinearImpulse(user.Value, -impulseVector / physics.Mass * pushbackRatio * MathF.Min(massLimit, physics.Mass), body: userPhysics); } } } diff --git a/Content.Shared/Throwing/ThrownItemSystem.cs b/Content.Shared/Throwing/ThrownItemSystem.cs index 8645d9b7233973..770273fa0327ac 100644 --- a/Content.Shared/Throwing/ThrownItemSystem.cs +++ b/Content.Shared/Throwing/ThrownItemSystem.cs @@ -92,7 +92,7 @@ public void StopThrow(EntityUid uid, ThrownItemComponent thrownItemComponent) { if (TryComp(uid, out var physics)) { - _physics.SetBodyStatus(physics, BodyStatus.OnGround); + _physics.SetBodyStatus(uid, physics, BodyStatus.OnGround); if (physics.Awake) _broadphase.RegenerateContacts(uid, physics); diff --git a/Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs b/Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs index fc364286549ef6..7886356233034f 100644 --- a/Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs +++ b/Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs @@ -74,7 +74,7 @@ private void OnThrownStartup(Entity ent, ref ComponentStar 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 @@ private void OnThrownStartup(Entity ent, ref ComponentStar private void OnThrownShutdown(Entity ent, ref ComponentShutdown args) { if (TryComp(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); } diff --git a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs index 99cd3fa030aa9e..dd297422c37997 100644 --- a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs +++ b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs @@ -207,12 +207,12 @@ protected virtual void StartTether(EntityUid gunUid, BaseForceGunComponent compo TransformSystem.Unanchor(target, targetXform); component.Tethered = target; var tethered = EnsureComp(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(component.Tethered.Value); @@ -264,9 +264,9 @@ protected virtual void StopTether(EntityUid gunUid, BaseForceGunComponent compon _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(component.Tethered.Value).OriginalAngularDamping); + _physics.SetAngularDamping(component.Tethered.Value, targetPhysics, Comp(component.Tethered.Value).OriginalAngularDamping); } if (!transfer) diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index c97e2b4555e260..129d536a70cbff 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -386,7 +386,7 @@ public abstract void Shoot( public void ShootProjectile(EntityUid uid, Vector2 direction, Vector2 gunVelocity, EntityUid gunUid, EntityUid? user = null, float speed = 20f) { var physics = EnsureComp(uid); - Physics.SetBodyStatus(physics, BodyStatus.InAir); + Physics.SetBodyStatus(uid, physics, BodyStatus.InAir); var targetMapVelocity = gunVelocity + direction.Normalized() * speed; var currentMapVelocity = Physics.GetMapLinearVelocity(uid, physics);