]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Code cleanup: Purge obsoleted SharedPhysicsSystem methods (#26287)
authorTayrtahn <tayrtahn@gmail.com>
Mon, 25 Mar 2024 06:37:25 +0000 (02:37 -0400)
committerGitHub <noreply@github.com>
Mon, 25 Mar 2024 06:37:25 +0000 (17:37 +1100)
Updated calls to SharedPhysicsSystem methods

16 files changed:
Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs
Content.Server/Chemistry/EntitySystems/VaporSystem.cs
Content.Server/ImmovableRod/ImmovableRodSystem.cs
Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.Emitter.cs
Content.Server/Physics/Controllers/ChasingWalkSystem.cs
Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs
Content.Server/Shuttles/Systems/ShuttleSystem.cs
Content.Server/StationEvents/Events/MeteorSwarmRule.cs
Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs
Content.Shared/Movement/Systems/SharedJetpackSystem.cs
Content.Shared/Throwing/ThrowingSystem.cs
Content.Shared/Throwing/ThrownItemSystem.cs
Content.Shared/Weapons/Melee/MeleeThrowOnHitSystem.cs
Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs

index 1047b4c9debfcd4d3bcbbf239f97c36b5e75238e..942882f7aef429dff69a703e2a5763fbcafb06c1 100644 (file)
@@ -409,7 +409,7 @@ public sealed partial class AdminVerbSystem
                     var fixtures = Comp<FixturesComponent>(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 @@ public sealed partial class AdminVerbSystem
 
                     _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 @@ public sealed partial class AdminVerbSystem
                     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 @@ public sealed partial class AdminVerbSystem
 
                     _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")
index 0ec89feaef96550c0800d12ddd7945d36d9baa3f..cb50ff114e0faaaa67b64b3f8646fe781428b5f1 100644 (file)
@@ -52,7 +52,7 @@ namespace Content.Server.Atmos.EntitySystems
                 if (HasComp<MobStateComponent>(uid) &&
                     TryComp<PhysicsComponent>(uid, out var body))
                 {
-                    _physics.SetBodyStatus(body, BodyStatus.OnGround);
+                    _physics.SetBodyStatus(uid, body, BodyStatus.OnGround);
                 }
 
                 if (TryComp<FixturesComponent>(uid, out var fixtures))
@@ -75,7 +75,7 @@ namespace Content.Server.Atmos.EntitySystems
             if (!TryComp<FixturesComponent>(uid, out var fixtures))
                 return;
 
-            _physics.SetBodyStatus(body, BodyStatus.InAir);
+            _physics.SetBodyStatus(uid, body, BodyStatus.InAir);
 
             foreach (var (id, fixture) in fixtures.Fixtures)
             {
@@ -94,9 +94,9 @@ namespace Content.Server.Atmos.EntitySystems
             // 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)));
index e174d39fc6f92a3339bb41f1f82a84069894ef5b..1415b6cad3c1e5815a661da5c9e453a75e60db7c 100644 (file)
@@ -64,8 +64,8 @@ namespace Content.Server.Chemistry.EntitySystems
             // 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);
 
index 36fca508fc89b908ecf99940447ac2de68bd0559..429361cd8cda0dc03f41117f874d4dfdce913665 100644 (file)
@@ -53,9 +53,9 @@ public sealed class ImmovableRodSystem : EntitySystem
     {
         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;
index 46b25163cc02e365f3e2bf07a5e28caf38a00161..06f1b6b154c56b13a402df4dadebb8dc7b66d961 100644 (file)
@@ -28,7 +28,7 @@ public sealed partial class ParticleAcceleratorSystem
         if (TryComp<PhysicsComponent>(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<PhysicsComponent>(uid, out var phys))
index 215e7e3124e87762e3e69208097a694927042e4d..618dd4156fc03a1a1e96ece15544e18858c6a6c0 100644 (file)
@@ -97,6 +97,6 @@ public sealed class ChasingWalkSystem : VirtualController
         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.
     }
 }
index d66eb665d04e14a2f3e2db904eec85146efcb78c..cb322ac396408c5fb8e3e9ff6a3722e140ed7e36 100644 (file)
@@ -371,8 +371,8 @@ public sealed partial class ShuttleSystem
         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 @@ public sealed partial class ShuttleSystem
 
         _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;
 
index 8d44dae4b2e5d56e0cd4cfd778e6df8c06aaea0b..7c42753a7de9dd4851d5babb84e8426c6d0c614f 100644 (file)
@@ -129,10 +129,10 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
             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 sealed partial class ShuttleSystem : SharedShuttleSystem
             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);
     }
 
index 192a620c9fcc1764f8c3cdb7ddd8d947f6c87fc5..ad56479b379decf453c2421563ae4b7d332b5fd3 100644 (file)
@@ -68,9 +68,9 @@ namespace Content.Server.StationEvents.Events
                 var spawnPosition = new MapCoordinates(center + offset, mapId);
                 var meteor = Spawn("MeteorLarge", spawnPosition);
                 var physics = EntityManager.GetComponent<PhysicsComponent>(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,
index 70e816b16e4429b2e56f4ca8ff2d67236adb4635..3d1fbf2b69624493f20a9b164c8a2d57b3ddcd2d 100644 (file)
@@ -358,7 +358,7 @@ public abstract partial class SharedBuckleSystem
 
         if (TryComp<PhysicsComponent>(buckleUid, out var physics))
         {
-            _physics.ResetDynamics(physics);
+            _physics.ResetDynamics(buckleUid, physics);
         }
 
         if (!buckleComp.PullStrap && TryComp<PullableComponent>(strapUid, out var toPullable))
index abe12b79d1ab31d81869b967a60b2ad384c153d2..8c42511f8469c1fc2c033a81bb057b9bbb67dc01 100644 (file)
@@ -92,7 +92,7 @@ public abstract class SharedJetpackSystem : EntitySystem
         _mover.SetRelay(user, jetpackUid);
 
         if (TryComp<PhysicsComponent>(user, out var physics))
-            _physics.SetBodyStatus(physics, BodyStatus.InAir);
+            _physics.SetBodyStatus(user, physics, BodyStatus.InAir);
 
         userComp.Jetpack = jetpackUid;
     }
@@ -103,7 +103,7 @@ public abstract class SharedJetpackSystem : EntitySystem
             return;
 
         if (TryComp<PhysicsComponent>(uid, out var physics))
-            _physics.SetBodyStatus(physics, BodyStatus.OnGround);
+            _physics.SetBodyStatus(uid, physics, BodyStatus.OnGround);
 
         RemComp<RelayInputMoverComponent>(uid);
     }
index 7c861a85adb0f7046b2af1478baa084a5366040d..38772eaf340ebe236679212c00998cc83c30aa15 100644 (file)
@@ -174,7 +174,7 @@ public sealed class ThrowingSystem : EntitySystem
         }
         else
         {
-            _physics.SetBodyStatus(physics, BodyStatus.InAir);
+            _physics.SetBodyStatus(uid, physics, BodyStatus.InAir);
         }
 
         if (user == null)
@@ -191,10 +191,10 @@ public sealed class ThrowingSystem : EntitySystem
         {
             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);
         }
     }
 }
index 8645d9b72339739855e97d060e1b932a49284bd4..770273fa0327ac6e8969bfb8b9ef0af381131876 100644 (file)
@@ -92,7 +92,7 @@ namespace Content.Shared.Throwing
         {
             if (TryComp<PhysicsComponent>(uid, out var physics))
             {
-                _physics.SetBodyStatus(physics, BodyStatus.OnGround);
+                _physics.SetBodyStatus(uid, physics, BodyStatus.OnGround);
 
                 if (physics.Awake)
                     _broadphase.RegenerateContacts(uid, physics);
index fc364286549ef6b8b2a2ad1304b344a5bba986c5..7886356233034f7448e9a5c485aa2a9a37d729ea 100644 (file)
@@ -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);
     }
index 99cd3fa030aa9eeb149b089df1c39daf231ef5d3..dd297422c37997489fc9eabcd9d1945c5d3978d0 100644 (file)
@@ -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)
index c97e2b4555e260d71deef31a90fbd0062f9b0d14..129d536a70cbff1a753b3d74def67039d226e30f 100644 (file)
@@ -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);