diff --git a/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs b/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs index 5e75795292..2372e872cb 100644 --- a/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs +++ b/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs @@ -26,8 +26,8 @@ public sealed class FlyBySoundSystem : SharedFlyBySoundSystem // If it's not our ent or we shot it. if (attachedEnt == null || - args.OtherFixture.Body.Owner != attachedEnt || - TryComp(args.OurFixture.Body.Owner, out var projectile) && + args.OtherEntity != attachedEnt || + TryComp(uid, out var projectile) && projectile.Shooter == attachedEnt) { return; diff --git a/Content.Server/Anomaly/AnomalySystem.cs b/Content.Server/Anomaly/AnomalySystem.cs index 781fe6014c..224a2ddab7 100644 --- a/Content.Server/Anomaly/AnomalySystem.cs +++ b/Content.Server/Anomaly/AnomalySystem.cs @@ -67,7 +67,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem private void OnStartCollide(EntityUid uid, AnomalyComponent component, ref StartCollideEvent args) { - if (!TryComp(args.OtherFixture.Body.Owner, out var particle)) + if (!TryComp(args.OtherEntity, out var particle)) return; if (args.OtherFixture.ID != particle.FixtureId) diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index 8baae83641..a57b66af80 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -131,7 +131,7 @@ namespace Content.Server.Atmos.EntitySystems private void OnCollide(EntityUid uid, FlammableComponent flammable, ref StartCollideEvent args) { - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; // Normal hard collisions, though this isn't generally possible since most flammable things are mobs // which don't collide with one another, shouldn't work here. diff --git a/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs index ef0d757b4a..9848463e3f 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs @@ -34,9 +34,9 @@ namespace Content.Server.Chemistry.EntitySystems private void HandleInjection(EntityUid uid, SolutionInjectOnCollideComponent component, ref StartCollideEvent args) { - var target = args.OtherFixture.Body.Owner; + var target = args.OtherEntity; - if (!args.OtherFixture.Body.Hard || + if (!args.OtherBody.Hard || !EntityManager.TryGetComponent(target, out var bloodstream) || !_solutionsSystem.TryGetInjectableSolution(component.Owner, out var solution)) return; @@ -53,7 +53,7 @@ namespace Content.Server.Chemistry.EntitySystems var solRemoved = solution.SplitSolution(component.TransferAmount); var solRemovedVol = solRemoved.Volume; - + var solToInject = solRemoved.SplitSolution(solRemovedVol * component.TransferEfficiency); _bloodstreamSystem.TryAddToChemicals(target, solToInject, bloodstream); diff --git a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs index 38e22ad14e..8fd6d31572 100644 --- a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs @@ -41,7 +41,7 @@ namespace Content.Server.Chemistry.EntitySystems foreach (var value in contents.Solutions.Values) { - value.DoEntityReaction(args.OtherFixture.Body.Owner, ReactionMethod.Touch); + value.DoEntityReaction(args.OtherEntity, ReactionMethod.Touch); } // Check for collision with a impassable object (e.g. wall) and stop diff --git a/Content.Server/Climbing/ClimbSystem.cs b/Content.Server/Climbing/ClimbSystem.cs index 6f1a4ca8e3..3f50fa824b 100644 --- a/Content.Server/Climbing/ClimbSystem.cs +++ b/Content.Server/Climbing/ClimbSystem.cs @@ -226,7 +226,7 @@ public sealed class ClimbSystem : SharedClimbSystem if (fixture == args.OtherFixture) continue; // If still colliding with a climbable, do not stop climbing - if (HasComp(fixture.Body.Owner)) + if (HasComp(args.OtherEntity)) return; } diff --git a/Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs b/Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs index 3bc08d4bb3..a1cc960431 100644 --- a/Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs +++ b/Content.Server/Damage/Systems/DamageOnHighSpeedImpactSystem.cs @@ -30,8 +30,8 @@ namespace Content.Server.Damage.Systems { if (!EntityManager.HasComponent(uid)) return; - var otherBody = args.OtherFixture.Body.Owner; - var speed = args.OurFixture.Body.LinearVelocity.Length; + var otherBody = args.OtherEntity; + var speed = args.OurBody.LinearVelocity.Length; if (speed < component.MinimumSpeed) return; diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index b7ac9086f6..7ec1413ba5 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -251,7 +251,7 @@ public sealed class DoorSystem : SharedDoorSystem if (door.State != DoorState.Closed) return; - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; if (Tags.HasTag(otherUid, "DoorBumpOpener")) TryOpen(uid, door, otherUid); @@ -290,12 +290,13 @@ public sealed class DoorSystem : SharedDoorSystem protected override void CheckDoorBump(DoorComponent component, PhysicsComponent body) { + var uid = body.Owner; if (component.BumpOpen) { - foreach (var other in PhysicsSystem.GetContactingEntities(body, approximate: true)) + foreach (var other in PhysicsSystem.GetContactingEntities(uid, body, approximate: true)) { - if (Tags.HasTag(other.Owner, "DoorBumpOpener") && - TryOpen(component.Owner, component, other.Owner, false, quiet: true)) break; + if (Tags.HasTag(other, "DoorBumpOpener") && TryOpen(uid, component, other, false, quiet: true)) + break; } } } diff --git a/Content.Server/Electrocution/ElectrocutionSystem.cs b/Content.Server/Electrocution/ElectrocutionSystem.cs index 11db6184e3..bb53b7a374 100644 --- a/Content.Server/Electrocution/ElectrocutionSystem.cs +++ b/Content.Server/Electrocution/ElectrocutionSystem.cs @@ -153,7 +153,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem private void OnElectrifiedStartCollide(EntityUid uid, ElectrifiedComponent electrified, ref StartCollideEvent args) { if (electrified.OnBump) - TryDoElectrifiedAct(uid, args.OtherFixture.Body.Owner, 1, electrified); + TryDoElectrifiedAct(uid, args.OtherEntity, 1, electrified); } private void OnElectrifiedAttacked(EntityUid uid, ElectrifiedComponent electrified, AttackedEvent args) diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs index 3499d66443..5c90577011 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs @@ -283,7 +283,7 @@ public sealed partial class ExplosionSystem : EntitySystem ref (List List, HashSet Processed, EntityQuery XformQuery) state, in FixtureProxy proxy) { - var owner = proxy.Fixture.Body.Owner; + var owner = proxy.Entity; return GridQueryCallback(ref state, in owner); } @@ -366,8 +366,8 @@ public sealed partial class ExplosionSystem : EntitySystem ref (List List, HashSet Processed, Matrix3 InvSpaceMatrix, EntityUid LookupOwner, EntityQuery XformQuery, Box2 GridBox) state, in FixtureProxy proxy) { - var owner = proxy.Fixture.Body.Owner; - return SpaceQueryCallback(ref state, in owner); + var uid = proxy.Entity; + return SpaceQueryCallback(ref state, in uid); } /// diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs index 07f44f7564..ede539af5f 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs @@ -77,14 +77,14 @@ public sealed partial class TriggerSystem if (args.OurFixture.ID != TriggerOnProximityComponent.FixtureID) return; _activeProximities.Add(component); - component.Colliding.Add(args.OtherFixture.Body); + component.Colliding.Add(args.OtherBody); } private static void OnProximityEndCollide(EntityUid uid, TriggerOnProximityComponent component, ref EndCollideEvent args) { if (args.OurFixture.ID != TriggerOnProximityComponent.FixtureID) return; - component.Colliding.Remove(args.OtherFixture.Body); + component.Colliding.Remove(args.OtherBody); } private void SetProximityAppearance(EntityUid uid, TriggerOnProximityComponent component) diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.TimedCollide.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.TimedCollide.cs index 2c3ecc605a..29b81deb32 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.TimedCollide.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.TimedCollide.cs @@ -19,7 +19,7 @@ public sealed partial class TriggerSystem { //Ensures the entity trigger will have an active component EnsureComp(uid); - var otherUID = args.OtherFixture.Body.Owner; + var otherUID = args.OtherEntity; if (component.Colliding.ContainsKey(otherUID)) return; component.Colliding.Add(otherUID, 0); @@ -27,7 +27,7 @@ public sealed partial class TriggerSystem private void OnTimerEndCollide(EntityUid uid, TriggerOnTimedCollideComponent component, ref EndCollideEvent args) { - var otherUID = args.OtherFixture.Body.Owner; + var otherUID = args.OtherEntity; component.Colliding.Remove(otherUID); if (component.Colliding.Count == 0 && HasComp(uid)) diff --git a/Content.Server/ImmovableRod/ImmovableRodSystem.cs b/Content.Server/ImmovableRod/ImmovableRodSystem.cs index ba41b28de7..36a16695f5 100644 --- a/Content.Server/ImmovableRod/ImmovableRodSystem.cs +++ b/Content.Server/ImmovableRod/ImmovableRodSystem.cs @@ -73,7 +73,7 @@ public sealed class ImmovableRodSystem : EntitySystem private void OnCollide(EntityUid uid, ImmovableRodComponent component, ref StartCollideEvent args) { - var ent = args.OtherFixture.Body.Owner; + var ent = args.OtherEntity; if (_random.Prob(component.HitSoundProbability)) { diff --git a/Content.Server/Polymorph/Systems/PolymorphSystem.Collide.cs b/Content.Server/Polymorph/Systems/PolymorphSystem.Collide.cs index 2fb28f39b9..c6a6417efe 100644 --- a/Content.Server/Polymorph/Systems/PolymorphSystem.Collide.cs +++ b/Content.Server/Polymorph/Systems/PolymorphSystem.Collide.cs @@ -36,7 +36,7 @@ public partial class PolymorphSystem if (args.OurFixture.ID != SharedProjectileSystem.ProjectileFixture) return; - var other = args.OtherFixture.Body.Owner; + var other = args.OtherEntity; if (!component.Whitelist.IsValid(other) || component.Blacklist != null && component.Blacklist.IsValid(other)) return; diff --git a/Content.Server/Projectiles/ProjectileSystem.cs b/Content.Server/Projectiles/ProjectileSystem.cs index 659de57e47..a9b02cdb8e 100644 --- a/Content.Server/Projectiles/ProjectileSystem.cs +++ b/Content.Server/Projectiles/ProjectileSystem.cs @@ -40,7 +40,7 @@ public sealed class ProjectileSystem : SharedProjectileSystem if (args.OurFixture.ID != ProjectileFixture || !args.OtherFixture.Hard || component.DamagedEntity) return; - var otherEntity = args.OtherFixture.Body.Owner; + var otherEntity = args.OtherEntity; // it's here so this check is only done once before possible hit var attemptEv = new ProjectileReflectAttemptEvent(uid, component, false); RaiseLocalEvent(otherEntity, ref attemptEv); @@ -51,7 +51,7 @@ public sealed class ProjectileSystem : SharedProjectileSystem } var otherName = ToPrettyString(otherEntity); - var direction = args.OurFixture.Body.LinearVelocity.Normalized; + var direction = args.OurBody.LinearVelocity.Normalized; var modifiedDamage = _damageableSystem.TryChangeDamage(otherEntity, component.Damage, component.IgnoreResistances, origin: component.Shooter); component.DamagedEntity = true; var deleted = Deleted(otherEntity); diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs index 889d4b6986..97be835cd1 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.Impact.cs @@ -23,25 +23,25 @@ public sealed partial class ShuttleSystem private void OnShuttleCollide(EntityUid uid, ShuttleComponent component, ref StartCollideEvent args) { - var ourBody = args.OurFixture.Body; - var otherBody = args.OtherFixture.Body; - - if (!HasComp(otherBody.Owner)) + if (!HasComp(args.OtherEntity)) return; + var ourBody = args.OurBody; + var otherBody = args.OtherBody; + // TODO: Would also be nice to have a continuous sound for scraping. - var ourXform = Transform(ourBody.Owner); + var ourXform = Transform(uid); if (ourXform.MapUid == null) return; - var otherXform = Transform(otherBody.Owner); + var otherXform = Transform(args.OtherEntity); var ourPoint = ourXform.InvWorldMatrix.Transform(args.WorldPoint); var otherPoint = otherXform.InvWorldMatrix.Transform(args.WorldPoint); - var ourVelocity = _physics.GetLinearVelocity(ourBody.Owner, ourPoint, ourBody, ourXform); - var otherVelocity = _physics.GetLinearVelocity(otherBody.Owner, otherPoint, otherBody, otherXform); + var ourVelocity = _physics.GetLinearVelocity(uid, ourPoint, ourBody, ourXform); + var otherVelocity = _physics.GetLinearVelocity(args.OtherEntity, otherPoint, otherBody, otherXform); var jungleDiff = (ourVelocity - otherVelocity).Length; if (jungleDiff < MinimumImpactVelocity) diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.cs index 1d4b7abbf1..e64f9022c0 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.cs @@ -58,7 +58,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem SubscribeLocalEvent(OnRoundRestart); SubscribeLocalEvent(OnGridInit); - SubscribeLocalEvent(OnGridFixtureChange); + SubscribeLocalEvent(OnGridFixtureChange); } public override void Update(float frameTime) @@ -81,22 +81,13 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem } } - private void OnGridFixtureChange(GridFixtureChangeEvent args) + private void OnGridFixtureChange(EntityUid uid, FixturesComponent manager, GridFixtureChangeEvent args) { - // Look this is jank but it's a placeholder until we design it. - if (args.NewFixtures.Count == 0) - return; - - var uid = args.NewFixtures[0].Body.Owner; - var manager = Comp(uid); - foreach (var fixture in args.NewFixtures) { _physics.SetDensity(uid, fixture, TileMassMultiplier, false, manager); _fixtures.SetRestitution(uid, fixture, 0.1f, false, manager); } - - _fixtures.FixtureUpdate(uid, manager: manager); } private void OnGridInit(GridInitializeEvent ev) diff --git a/Content.Server/Shuttles/Systems/SpaceGarbageSystem.cs b/Content.Server/Shuttles/Systems/SpaceGarbageSystem.cs index ca8304e555..7a5b4c9870 100644 --- a/Content.Server/Shuttles/Systems/SpaceGarbageSystem.cs +++ b/Content.Server/Shuttles/Systems/SpaceGarbageSystem.cs @@ -18,10 +18,10 @@ public sealed class SpaceGarbageSystem : EntitySystem private void OnCollide(EntityUid uid, SpaceGarbageComponent component, ref StartCollideEvent args) { - if (args.OtherFixture.Body.BodyType != BodyType.Static) return; + if (args.OtherBody.BodyType != BodyType.Static) return; - var ourXform = Transform(args.OurFixture.Body.Owner); - var otherXform = Transform(args.OtherFixture.Body.Owner); + var ourXform = Transform(uid); + var otherXform = Transform(args.OtherEntity); if (ourXform.GridUid == otherXform.GridUid) return; diff --git a/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs b/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs index 1d6449c31d..979e8565e8 100644 --- a/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs +++ b/Content.Server/Singularity/EntitySystems/ContainmentFieldGeneratorSystem.cs @@ -60,7 +60,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem /// private void HandleGeneratorCollide(EntityUid uid, ContainmentFieldGeneratorComponent component, ref StartCollideEvent args) { - if (_tags.HasTag(args.OtherFixture.Body.Owner, component.IDTag)) + if (_tags.HasTag(args.OtherEntity, component.IDTag)) { ReceivePower(component.PowerReceived, component); component.Accumulator = 0f; diff --git a/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs b/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs index 48487cbb94..c03ea25b7c 100644 --- a/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs +++ b/Content.Server/Singularity/EntitySystems/ContainmentFieldSystem.cs @@ -24,7 +24,7 @@ public sealed class ContainmentFieldSystem : EntitySystem private void HandleFieldCollide(EntityUid uid, ContainmentFieldComponent component, ref StartCollideEvent args) { - var otherBody = args.OtherFixture.Body.Owner; + var otherBody = args.OtherEntity; if (TryComp(otherBody, out var garbage)) { diff --git a/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs b/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs index df4ae73493..97e9fb9f31 100644 --- a/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs +++ b/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs @@ -421,7 +421,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem if (args.OurFixture.ID != comp.HorizonFixtureId) return; - AttemptConsumeEntity(args.OtherFixture.Body.Owner, comp); + AttemptConsumeEntity(args.OtherEntity, comp); } /// diff --git a/Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs b/Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs index cc26123eec..6db478dead 100644 --- a/Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs +++ b/Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs @@ -123,7 +123,7 @@ public sealed class SingularityGeneratorSystem : EntitySystem /// The state of the beginning of the collision. private void HandleParticleCollide(EntityUid uid, ParticleProjectileComponent component, ref StartCollideEvent args) { - if (EntityManager.TryGetComponent(args.OtherFixture.Body.Owner, out var singularityGeneratorComponent)) + if (EntityManager.TryGetComponent(args.OtherEntity, out var singularityGeneratorComponent)) { SetPower( singularityGeneratorComponent, diff --git a/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs b/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs index f7734622c5..92a2e91a22 100644 --- a/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs +++ b/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs @@ -44,7 +44,7 @@ namespace Content.Server.Stunnable { if (args.OurFixture.ID != component.FixtureID) return; - TryDoCollideStun(uid, component, args.OtherFixture.Body.Owner); + TryDoCollideStun(uid, component, args.OtherEntity); } private void HandleThrow(EntityUid uid, StunOnCollideComponent component, ThrowDoHitEvent args) diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs index 363c3f1e03..8989df0ec1 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs @@ -449,7 +449,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem private void OnCollide(EntityUid uid, ArtifactAnalyzerComponent component, ref StartCollideEvent args) { - var otherEnt = args.OtherFixture.Body.Owner; + var otherEnt = args.OtherEntity; if (!HasComp(otherEnt)) return; @@ -462,7 +462,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem private void OnEndCollide(EntityUid uid, ArtifactAnalyzerComponent component, ref EndCollideEvent args) { - var otherEnt = args.OtherFixture.Body.Owner; + var otherEnt = args.OtherEntity; if (!HasComp(otherEnt)) return; diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs index 190cb51bdd..e4617efb1b 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs @@ -90,7 +90,7 @@ public sealed class TraversalDistorterSystem : EntitySystem private void OnCollide(EntityUid uid, TraversalDistorterComponent component, ref StartCollideEvent args) { - var otherEnt = args.OtherFixture.Body.Owner; + var otherEnt = args.OtherEntity; if (!HasComp(otherEnt)) return; @@ -101,7 +101,7 @@ public sealed class TraversalDistorterSystem : EntitySystem private void OnEndCollide(EntityUid uid, TraversalDistorterComponent component, ref EndCollideEvent args) { - var otherEnt = args.OtherFixture.Body.Owner; + var otherEnt = args.OtherEntity; if (!HasComp(otherEnt)) return; diff --git a/Content.Shared/Damage/Systems/DamageContactsSystem.cs b/Content.Shared/Damage/Systems/DamageContactsSystem.cs index 891526bbb0..32757a563c 100644 --- a/Content.Shared/Damage/Systems/DamageContactsSystem.cs +++ b/Content.Shared/Damage/Systems/DamageContactsSystem.cs @@ -37,15 +37,14 @@ public sealed class DamageContactsSystem : EntitySystem private void OnEntityExit(EntityUid uid, DamageContactsComponent component, ref EndCollideEvent args) { - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; if (!TryComp(uid, out var body)) return; var damageQuery = GetEntityQuery(); - foreach (var contact in _physics.GetContactingEntities(body)) + foreach (var ent in _physics.GetContactingEntities(uid, body)) { - var ent = contact.Owner; if (ent == uid) continue; @@ -58,7 +57,7 @@ public sealed class DamageContactsSystem : EntitySystem private void OnEntityEnter(EntityUid uid, DamageContactsComponent component, ref StartCollideEvent args) { - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; if (HasComp(otherUid)) return; diff --git a/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs b/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs index 8d8784a173..8400b26ee7 100644 --- a/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs +++ b/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs @@ -87,7 +87,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem return; if (!TryComp(uid, out var reclaimer)) return; - TryStartProcessItem(uid, args.OtherFixture.Body.Owner, reclaimer); + TryStartProcessItem(uid, args.OtherEntity, reclaimer); } private void OnActiveStartup(EntityUid uid, ActiveMaterialReclaimerComponent component, ComponentStartup args) diff --git a/Content.Shared/Movement/Systems/SlowContactsSystem.cs b/Content.Shared/Movement/Systems/SlowContactsSystem.cs index c318b6628b..44e64218e0 100644 --- a/Content.Shared/Movement/Systems/SlowContactsSystem.cs +++ b/Content.Shared/Movement/Systems/SlowContactsSystem.cs @@ -69,9 +69,8 @@ public sealed class SlowContactsSystem : EntitySystem var sprintSpeed = 1.0f; bool remove = true; - foreach (var colliding in _physics.GetContactingEntities(physicsComponent)) + foreach (var ent in _physics.GetContactingEntities(uid, physicsComponent)) { - var ent = colliding.Owner; if (!TryComp(ent, out var slowContactsComponent)) continue; @@ -92,14 +91,14 @@ public sealed class SlowContactsSystem : EntitySystem private void OnEntityExit(EntityUid uid, SlowContactsComponent component, ref EndCollideEvent args) { - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; if (HasComp(otherUid)) _toUpdate.Add(otherUid); } private void OnEntityEnter(EntityUid uid, SlowContactsComponent component, ref StartCollideEvent args) { - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; if (!HasComp(otherUid)) return; diff --git a/Content.Shared/Physics/Controllers/SharedConveyorController.cs b/Content.Shared/Physics/Controllers/SharedConveyorController.cs index 9dce765692..9762c0d807 100644 --- a/Content.Shared/Physics/Controllers/SharedConveyorController.cs +++ b/Content.Shared/Physics/Controllers/SharedConveyorController.cs @@ -49,9 +49,9 @@ public abstract class SharedConveyorController : VirtualController private void OnConveyorStartCollide(EntityUid uid, ConveyorComponent component, ref StartCollideEvent args) { - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; - if (args.OtherFixture.Body.BodyType == BodyType.Static || component.State == ConveyorState.Off) + if (args.OtherBody.BodyType == BodyType.Static || component.State == ConveyorState.Off) return; component.Intersecting.Add(otherUid); @@ -60,7 +60,7 @@ public abstract class SharedConveyorController : VirtualController private void OnConveyorEndCollide(EntityUid uid, ConveyorComponent component, ref EndCollideEvent args) { - component.Intersecting.Remove(args.OtherFixture.Body.Owner); + component.Intersecting.Remove(args.OtherEntity); if (component.Intersecting.Count == 0) RemComp(uid); diff --git a/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs b/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs index 44274e0d7c..d4fcf1ce5c 100644 --- a/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs +++ b/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs @@ -128,7 +128,7 @@ public sealed class StepTriggerSystem : EntitySystem private void OnStartCollide(EntityUid uid, StepTriggerComponent component, ref StartCollideEvent args) { - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; if (!args.OtherFixture.Hard) return; @@ -146,7 +146,7 @@ public sealed class StepTriggerSystem : EntitySystem private void OnEndCollide(EntityUid uid, StepTriggerComponent component, ref EndCollideEvent args) { - var otherUid = args.OtherFixture.Body.Owner; + var otherUid = args.OtherEntity; if (!component.Colliding.Remove(otherUid)) return; diff --git a/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs b/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs index b24047fcea..f21c9b2efd 100644 --- a/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs +++ b/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs @@ -59,7 +59,7 @@ public abstract class SharedPortalSystem : EntitySystem if (!ShouldCollide(args.OurFixture, args.OtherFixture)) return; - var subject = args.OtherFixture.Body.Owner; + var subject = args.OtherEntity; // best not. if (Transform(subject).Anchored) @@ -127,7 +127,7 @@ public abstract class SharedPortalSystem : EntitySystem if (!ShouldCollide(args.OurFixture, args.OtherFixture)) return; - var subject = args.OtherFixture.Body.Owner; + var subject = args.OtherEntity; // if they came from (not us), remove the timeout if (TryComp(subject, out var timeout) && timeout.EnteredPortal != uid) diff --git a/Content.Shared/Throwing/ThrownItemSystem.cs b/Content.Shared/Throwing/ThrownItemSystem.cs index 62ae7883a7..6467ea2d77 100644 --- a/Content.Shared/Throwing/ThrownItemSystem.cs +++ b/Content.Shared/Throwing/ThrownItemSystem.cs @@ -74,10 +74,10 @@ namespace Content.Shared.Throwing return; var thrower = component.Thrower; - var otherBody = args.OtherFixture.Body; + if (args.OtherEntity == thrower) + return; - if (otherBody.Owner == thrower) return; - ThrowCollideInteraction(thrower, args.OurFixture.Body, otherBody); + ThrowCollideInteraction(thrower, args.OurBody, args.OtherBody); } private void PreventCollision(EntityUid uid, ThrownItemComponent component, ref PreventCollideEvent args)