Remove obsolete Fixture.Body references (#16259)

This commit is contained in:
Leon Friedrich
2023-05-09 19:21:26 +12:00
committed by GitHub
parent dac7025cc5
commit 2bd5fb3736
32 changed files with 67 additions and 77 deletions

View File

@@ -26,8 +26,8 @@ public sealed class FlyBySoundSystem : SharedFlyBySoundSystem
// If it's not our ent or we shot it. // If it's not our ent or we shot it.
if (attachedEnt == null || if (attachedEnt == null ||
args.OtherFixture.Body.Owner != attachedEnt || args.OtherEntity != attachedEnt ||
TryComp<ProjectileComponent>(args.OurFixture.Body.Owner, out var projectile) && TryComp<ProjectileComponent>(uid, out var projectile) &&
projectile.Shooter == attachedEnt) projectile.Shooter == attachedEnt)
{ {
return; return;

View File

@@ -67,7 +67,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
private void OnStartCollide(EntityUid uid, AnomalyComponent component, ref StartCollideEvent args) private void OnStartCollide(EntityUid uid, AnomalyComponent component, ref StartCollideEvent args)
{ {
if (!TryComp<AnomalousParticleComponent>(args.OtherFixture.Body.Owner, out var particle)) if (!TryComp<AnomalousParticleComponent>(args.OtherEntity, out var particle))
return; return;
if (args.OtherFixture.ID != particle.FixtureId) if (args.OtherFixture.ID != particle.FixtureId)

View File

@@ -131,7 +131,7 @@ namespace Content.Server.Atmos.EntitySystems
private void OnCollide(EntityUid uid, FlammableComponent flammable, ref StartCollideEvent args) 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 // 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. // which don't collide with one another, shouldn't work here.

View File

@@ -34,9 +34,9 @@ namespace Content.Server.Chemistry.EntitySystems
private void HandleInjection(EntityUid uid, SolutionInjectOnCollideComponent component, ref StartCollideEvent args) 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<BloodstreamComponent>(target, out var bloodstream) || !EntityManager.TryGetComponent<BloodstreamComponent>(target, out var bloodstream) ||
!_solutionsSystem.TryGetInjectableSolution(component.Owner, out var solution)) return; !_solutionsSystem.TryGetInjectableSolution(component.Owner, out var solution)) return;
@@ -53,7 +53,7 @@ namespace Content.Server.Chemistry.EntitySystems
var solRemoved = solution.SplitSolution(component.TransferAmount); var solRemoved = solution.SplitSolution(component.TransferAmount);
var solRemovedVol = solRemoved.Volume; var solRemovedVol = solRemoved.Volume;
var solToInject = solRemoved.SplitSolution(solRemovedVol * component.TransferEfficiency); var solToInject = solRemoved.SplitSolution(solRemovedVol * component.TransferEfficiency);
_bloodstreamSystem.TryAddToChemicals(target, solToInject, bloodstream); _bloodstreamSystem.TryAddToChemicals(target, solToInject, bloodstream);

View File

@@ -41,7 +41,7 @@ namespace Content.Server.Chemistry.EntitySystems
foreach (var value in contents.Solutions.Values) 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 // Check for collision with a impassable object (e.g. wall) and stop

View File

@@ -226,7 +226,7 @@ public sealed class ClimbSystem : SharedClimbSystem
if (fixture == args.OtherFixture) if (fixture == args.OtherFixture)
continue; continue;
// If still colliding with a climbable, do not stop climbing // If still colliding with a climbable, do not stop climbing
if (HasComp<ClimbableComponent>(fixture.Body.Owner)) if (HasComp<ClimbableComponent>(args.OtherEntity))
return; return;
} }

View File

@@ -30,8 +30,8 @@ namespace Content.Server.Damage.Systems
{ {
if (!EntityManager.HasComponent<DamageableComponent>(uid)) return; if (!EntityManager.HasComponent<DamageableComponent>(uid)) return;
var otherBody = args.OtherFixture.Body.Owner; var otherBody = args.OtherEntity;
var speed = args.OurFixture.Body.LinearVelocity.Length; var speed = args.OurBody.LinearVelocity.Length;
if (speed < component.MinimumSpeed) return; if (speed < component.MinimumSpeed) return;

View File

@@ -251,7 +251,7 @@ public sealed class DoorSystem : SharedDoorSystem
if (door.State != DoorState.Closed) if (door.State != DoorState.Closed)
return; return;
var otherUid = args.OtherFixture.Body.Owner; var otherUid = args.OtherEntity;
if (Tags.HasTag(otherUid, "DoorBumpOpener")) if (Tags.HasTag(otherUid, "DoorBumpOpener"))
TryOpen(uid, door, otherUid); TryOpen(uid, door, otherUid);
@@ -290,12 +290,13 @@ public sealed class DoorSystem : SharedDoorSystem
protected override void CheckDoorBump(DoorComponent component, PhysicsComponent body) protected override void CheckDoorBump(DoorComponent component, PhysicsComponent body)
{ {
var uid = body.Owner;
if (component.BumpOpen) 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") && if (Tags.HasTag(other, "DoorBumpOpener") && TryOpen(uid, component, other, false, quiet: true))
TryOpen(component.Owner, component, other.Owner, false, quiet: true)) break; break;
} }
} }
} }

View File

@@ -153,7 +153,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
private void OnElectrifiedStartCollide(EntityUid uid, ElectrifiedComponent electrified, ref StartCollideEvent args) private void OnElectrifiedStartCollide(EntityUid uid, ElectrifiedComponent electrified, ref StartCollideEvent args)
{ {
if (electrified.OnBump) 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) private void OnElectrifiedAttacked(EntityUid uid, ElectrifiedComponent electrified, AttackedEvent args)

View File

@@ -283,7 +283,7 @@ public sealed partial class ExplosionSystem : EntitySystem
ref (List<TransformComponent> List, HashSet<EntityUid> Processed, EntityQuery<TransformComponent> XformQuery) state, ref (List<TransformComponent> List, HashSet<EntityUid> Processed, EntityQuery<TransformComponent> XformQuery) state,
in FixtureProxy proxy) in FixtureProxy proxy)
{ {
var owner = proxy.Fixture.Body.Owner; var owner = proxy.Entity;
return GridQueryCallback(ref state, in owner); return GridQueryCallback(ref state, in owner);
} }
@@ -366,8 +366,8 @@ public sealed partial class ExplosionSystem : EntitySystem
ref (List<TransformComponent> List, HashSet<EntityUid> Processed, Matrix3 InvSpaceMatrix, EntityUid LookupOwner, EntityQuery<TransformComponent> XformQuery, Box2 GridBox) state, ref (List<TransformComponent> List, HashSet<EntityUid> Processed, Matrix3 InvSpaceMatrix, EntityUid LookupOwner, EntityQuery<TransformComponent> XformQuery, Box2 GridBox) state,
in FixtureProxy proxy) in FixtureProxy proxy)
{ {
var owner = proxy.Fixture.Body.Owner; var uid = proxy.Entity;
return SpaceQueryCallback(ref state, in owner); return SpaceQueryCallback(ref state, in uid);
} }
/// <summary> /// <summary>

View File

@@ -77,14 +77,14 @@ public sealed partial class TriggerSystem
if (args.OurFixture.ID != TriggerOnProximityComponent.FixtureID) return; if (args.OurFixture.ID != TriggerOnProximityComponent.FixtureID) return;
_activeProximities.Add(component); _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) private static void OnProximityEndCollide(EntityUid uid, TriggerOnProximityComponent component, ref EndCollideEvent args)
{ {
if (args.OurFixture.ID != TriggerOnProximityComponent.FixtureID) return; 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) private void SetProximityAppearance(EntityUid uid, TriggerOnProximityComponent component)

View File

@@ -19,7 +19,7 @@ public sealed partial class TriggerSystem
{ {
//Ensures the entity trigger will have an active component //Ensures the entity trigger will have an active component
EnsureComp<ActiveTriggerOnTimedCollideComponent>(uid); EnsureComp<ActiveTriggerOnTimedCollideComponent>(uid);
var otherUID = args.OtherFixture.Body.Owner; var otherUID = args.OtherEntity;
if (component.Colliding.ContainsKey(otherUID)) if (component.Colliding.ContainsKey(otherUID))
return; return;
component.Colliding.Add(otherUID, 0); component.Colliding.Add(otherUID, 0);
@@ -27,7 +27,7 @@ public sealed partial class TriggerSystem
private void OnTimerEndCollide(EntityUid uid, TriggerOnTimedCollideComponent component, ref EndCollideEvent args) private void OnTimerEndCollide(EntityUid uid, TriggerOnTimedCollideComponent component, ref EndCollideEvent args)
{ {
var otherUID = args.OtherFixture.Body.Owner; var otherUID = args.OtherEntity;
component.Colliding.Remove(otherUID); component.Colliding.Remove(otherUID);
if (component.Colliding.Count == 0 && HasComp<ActiveTriggerOnTimedCollideComponent>(uid)) if (component.Colliding.Count == 0 && HasComp<ActiveTriggerOnTimedCollideComponent>(uid))

View File

@@ -73,7 +73,7 @@ public sealed class ImmovableRodSystem : EntitySystem
private void OnCollide(EntityUid uid, ImmovableRodComponent component, ref StartCollideEvent args) 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)) if (_random.Prob(component.HitSoundProbability))
{ {

View File

@@ -36,7 +36,7 @@ public partial class PolymorphSystem
if (args.OurFixture.ID != SharedProjectileSystem.ProjectileFixture) if (args.OurFixture.ID != SharedProjectileSystem.ProjectileFixture)
return; return;
var other = args.OtherFixture.Body.Owner; var other = args.OtherEntity;
if (!component.Whitelist.IsValid(other) if (!component.Whitelist.IsValid(other)
|| component.Blacklist != null && component.Blacklist.IsValid(other)) || component.Blacklist != null && component.Blacklist.IsValid(other))
return; return;

View File

@@ -40,7 +40,7 @@ public sealed class ProjectileSystem : SharedProjectileSystem
if (args.OurFixture.ID != ProjectileFixture || !args.OtherFixture.Hard || component.DamagedEntity) if (args.OurFixture.ID != ProjectileFixture || !args.OtherFixture.Hard || component.DamagedEntity)
return; return;
var otherEntity = args.OtherFixture.Body.Owner; var otherEntity = args.OtherEntity;
// it's here so this check is only done once before possible hit // it's here so this check is only done once before possible hit
var attemptEv = new ProjectileReflectAttemptEvent(uid, component, false); var attemptEv = new ProjectileReflectAttemptEvent(uid, component, false);
RaiseLocalEvent(otherEntity, ref attemptEv); RaiseLocalEvent(otherEntity, ref attemptEv);
@@ -51,7 +51,7 @@ public sealed class ProjectileSystem : SharedProjectileSystem
} }
var otherName = ToPrettyString(otherEntity); 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); var modifiedDamage = _damageableSystem.TryChangeDamage(otherEntity, component.Damage, component.IgnoreResistances, origin: component.Shooter);
component.DamagedEntity = true; component.DamagedEntity = true;
var deleted = Deleted(otherEntity); var deleted = Deleted(otherEntity);

View File

@@ -23,25 +23,25 @@ public sealed partial class ShuttleSystem
private void OnShuttleCollide(EntityUid uid, ShuttleComponent component, ref StartCollideEvent args) private void OnShuttleCollide(EntityUid uid, ShuttleComponent component, ref StartCollideEvent args)
{ {
var ourBody = args.OurFixture.Body; if (!HasComp<ShuttleComponent>(args.OtherEntity))
var otherBody = args.OtherFixture.Body;
if (!HasComp<ShuttleComponent>(otherBody.Owner))
return; return;
var ourBody = args.OurBody;
var otherBody = args.OtherBody;
// TODO: Would also be nice to have a continuous sound for scraping. // 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) if (ourXform.MapUid == null)
return; return;
var otherXform = Transform(otherBody.Owner); var otherXform = Transform(args.OtherEntity);
var ourPoint = ourXform.InvWorldMatrix.Transform(args.WorldPoint); var ourPoint = ourXform.InvWorldMatrix.Transform(args.WorldPoint);
var otherPoint = otherXform.InvWorldMatrix.Transform(args.WorldPoint); var otherPoint = otherXform.InvWorldMatrix.Transform(args.WorldPoint);
var ourVelocity = _physics.GetLinearVelocity(ourBody.Owner, ourPoint, ourBody, ourXform); var ourVelocity = _physics.GetLinearVelocity(uid, ourPoint, ourBody, ourXform);
var otherVelocity = _physics.GetLinearVelocity(otherBody.Owner, otherPoint, otherBody, otherXform); var otherVelocity = _physics.GetLinearVelocity(args.OtherEntity, otherPoint, otherBody, otherXform);
var jungleDiff = (ourVelocity - otherVelocity).Length; var jungleDiff = (ourVelocity - otherVelocity).Length;
if (jungleDiff < MinimumImpactVelocity) if (jungleDiff < MinimumImpactVelocity)

View File

@@ -58,7 +58,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart); SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
SubscribeLocalEvent<GridInitializeEvent>(OnGridInit); SubscribeLocalEvent<GridInitializeEvent>(OnGridInit);
SubscribeLocalEvent<GridFixtureChangeEvent>(OnGridFixtureChange); SubscribeLocalEvent<FixturesComponent, GridFixtureChangeEvent>(OnGridFixtureChange);
} }
public override void Update(float frameTime) 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<FixturesComponent>(uid);
foreach (var fixture in args.NewFixtures) foreach (var fixture in args.NewFixtures)
{ {
_physics.SetDensity(uid, fixture, TileMassMultiplier, false, manager); _physics.SetDensity(uid, fixture, TileMassMultiplier, false, manager);
_fixtures.SetRestitution(uid, fixture, 0.1f, false, manager); _fixtures.SetRestitution(uid, fixture, 0.1f, false, manager);
} }
_fixtures.FixtureUpdate(uid, manager: manager);
} }
private void OnGridInit(GridInitializeEvent ev) private void OnGridInit(GridInitializeEvent ev)

View File

@@ -18,10 +18,10 @@ public sealed class SpaceGarbageSystem : EntitySystem
private void OnCollide(EntityUid uid, SpaceGarbageComponent component, ref StartCollideEvent args) 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 ourXform = Transform(uid);
var otherXform = Transform(args.OtherFixture.Body.Owner); var otherXform = Transform(args.OtherEntity);
if (ourXform.GridUid == otherXform.GridUid) return; if (ourXform.GridUid == otherXform.GridUid) return;

View File

@@ -60,7 +60,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem
/// </summary> /// </summary>
private void HandleGeneratorCollide(EntityUid uid, ContainmentFieldGeneratorComponent component, ref StartCollideEvent args) 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); ReceivePower(component.PowerReceived, component);
component.Accumulator = 0f; component.Accumulator = 0f;

View File

@@ -24,7 +24,7 @@ public sealed class ContainmentFieldSystem : EntitySystem
private void HandleFieldCollide(EntityUid uid, ContainmentFieldComponent component, ref StartCollideEvent args) private void HandleFieldCollide(EntityUid uid, ContainmentFieldComponent component, ref StartCollideEvent args)
{ {
var otherBody = args.OtherFixture.Body.Owner; var otherBody = args.OtherEntity;
if (TryComp<SpaceGarbageComponent>(otherBody, out var garbage)) if (TryComp<SpaceGarbageComponent>(otherBody, out var garbage))
{ {

View File

@@ -421,7 +421,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
if (args.OurFixture.ID != comp.HorizonFixtureId) if (args.OurFixture.ID != comp.HorizonFixtureId)
return; return;
AttemptConsumeEntity(args.OtherFixture.Body.Owner, comp); AttemptConsumeEntity(args.OtherEntity, comp);
} }
/// <summary> /// <summary>

View File

@@ -123,7 +123,7 @@ public sealed class SingularityGeneratorSystem : EntitySystem
/// <param name="args">The state of the beginning of the collision.</param> /// <param name="args">The state of the beginning of the collision.</param>
private void HandleParticleCollide(EntityUid uid, ParticleProjectileComponent component, ref StartCollideEvent args) private void HandleParticleCollide(EntityUid uid, ParticleProjectileComponent component, ref StartCollideEvent args)
{ {
if (EntityManager.TryGetComponent<SingularityGeneratorComponent?>(args.OtherFixture.Body.Owner, out var singularityGeneratorComponent)) if (EntityManager.TryGetComponent<SingularityGeneratorComponent?>(args.OtherEntity, out var singularityGeneratorComponent))
{ {
SetPower( SetPower(
singularityGeneratorComponent, singularityGeneratorComponent,

View File

@@ -44,7 +44,7 @@ namespace Content.Server.Stunnable
{ {
if (args.OurFixture.ID != component.FixtureID) return; 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) private void HandleThrow(EntityUid uid, StunOnCollideComponent component, ThrowDoHitEvent args)

View File

@@ -449,7 +449,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
private void OnCollide(EntityUid uid, ArtifactAnalyzerComponent component, ref StartCollideEvent args) private void OnCollide(EntityUid uid, ArtifactAnalyzerComponent component, ref StartCollideEvent args)
{ {
var otherEnt = args.OtherFixture.Body.Owner; var otherEnt = args.OtherEntity;
if (!HasComp<ArtifactComponent>(otherEnt)) if (!HasComp<ArtifactComponent>(otherEnt))
return; return;
@@ -462,7 +462,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
private void OnEndCollide(EntityUid uid, ArtifactAnalyzerComponent component, ref EndCollideEvent args) private void OnEndCollide(EntityUid uid, ArtifactAnalyzerComponent component, ref EndCollideEvent args)
{ {
var otherEnt = args.OtherFixture.Body.Owner; var otherEnt = args.OtherEntity;
if (!HasComp<ArtifactComponent>(otherEnt)) if (!HasComp<ArtifactComponent>(otherEnt))
return; return;

View File

@@ -90,7 +90,7 @@ public sealed class TraversalDistorterSystem : EntitySystem
private void OnCollide(EntityUid uid, TraversalDistorterComponent component, ref StartCollideEvent args) private void OnCollide(EntityUid uid, TraversalDistorterComponent component, ref StartCollideEvent args)
{ {
var otherEnt = args.OtherFixture.Body.Owner; var otherEnt = args.OtherEntity;
if (!HasComp<ArtifactComponent>(otherEnt)) if (!HasComp<ArtifactComponent>(otherEnt))
return; return;
@@ -101,7 +101,7 @@ public sealed class TraversalDistorterSystem : EntitySystem
private void OnEndCollide(EntityUid uid, TraversalDistorterComponent component, ref EndCollideEvent args) private void OnEndCollide(EntityUid uid, TraversalDistorterComponent component, ref EndCollideEvent args)
{ {
var otherEnt = args.OtherFixture.Body.Owner; var otherEnt = args.OtherEntity;
if (!HasComp<ArtifactComponent>(otherEnt)) if (!HasComp<ArtifactComponent>(otherEnt))
return; return;

View File

@@ -37,15 +37,14 @@ public sealed class DamageContactsSystem : EntitySystem
private void OnEntityExit(EntityUid uid, DamageContactsComponent component, ref EndCollideEvent args) private void OnEntityExit(EntityUid uid, DamageContactsComponent component, ref EndCollideEvent args)
{ {
var otherUid = args.OtherFixture.Body.Owner; var otherUid = args.OtherEntity;
if (!TryComp<PhysicsComponent>(uid, out var body)) if (!TryComp<PhysicsComponent>(uid, out var body))
return; return;
var damageQuery = GetEntityQuery<DamageContactsComponent>(); var damageQuery = GetEntityQuery<DamageContactsComponent>();
foreach (var contact in _physics.GetContactingEntities(body)) foreach (var ent in _physics.GetContactingEntities(uid, body))
{ {
var ent = contact.Owner;
if (ent == uid) if (ent == uid)
continue; continue;
@@ -58,7 +57,7 @@ public sealed class DamageContactsSystem : EntitySystem
private void OnEntityEnter(EntityUid uid, DamageContactsComponent component, ref StartCollideEvent args) private void OnEntityEnter(EntityUid uid, DamageContactsComponent component, ref StartCollideEvent args)
{ {
var otherUid = args.OtherFixture.Body.Owner; var otherUid = args.OtherEntity;
if (HasComp<DamagedByContactComponent>(otherUid)) if (HasComp<DamagedByContactComponent>(otherUid))
return; return;

View File

@@ -87,7 +87,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
return; return;
if (!TryComp<MaterialReclaimerComponent>(uid, out var reclaimer)) if (!TryComp<MaterialReclaimerComponent>(uid, out var reclaimer))
return; return;
TryStartProcessItem(uid, args.OtherFixture.Body.Owner, reclaimer); TryStartProcessItem(uid, args.OtherEntity, reclaimer);
} }
private void OnActiveStartup(EntityUid uid, ActiveMaterialReclaimerComponent component, ComponentStartup args) private void OnActiveStartup(EntityUid uid, ActiveMaterialReclaimerComponent component, ComponentStartup args)

View File

@@ -69,9 +69,8 @@ public sealed class SlowContactsSystem : EntitySystem
var sprintSpeed = 1.0f; var sprintSpeed = 1.0f;
bool remove = true; bool remove = true;
foreach (var colliding in _physics.GetContactingEntities(physicsComponent)) foreach (var ent in _physics.GetContactingEntities(uid, physicsComponent))
{ {
var ent = colliding.Owner;
if (!TryComp<SlowContactsComponent>(ent, out var slowContactsComponent)) if (!TryComp<SlowContactsComponent>(ent, out var slowContactsComponent))
continue; continue;
@@ -92,14 +91,14 @@ public sealed class SlowContactsSystem : EntitySystem
private void OnEntityExit(EntityUid uid, SlowContactsComponent component, ref EndCollideEvent args) private void OnEntityExit(EntityUid uid, SlowContactsComponent component, ref EndCollideEvent args)
{ {
var otherUid = args.OtherFixture.Body.Owner; var otherUid = args.OtherEntity;
if (HasComp<MovementSpeedModifierComponent>(otherUid)) if (HasComp<MovementSpeedModifierComponent>(otherUid))
_toUpdate.Add(otherUid); _toUpdate.Add(otherUid);
} }
private void OnEntityEnter(EntityUid uid, SlowContactsComponent component, ref StartCollideEvent args) private void OnEntityEnter(EntityUid uid, SlowContactsComponent component, ref StartCollideEvent args)
{ {
var otherUid = args.OtherFixture.Body.Owner; var otherUid = args.OtherEntity;
if (!HasComp<MovementSpeedModifierComponent>(otherUid)) if (!HasComp<MovementSpeedModifierComponent>(otherUid))
return; return;

View File

@@ -49,9 +49,9 @@ public abstract class SharedConveyorController : VirtualController
private void OnConveyorStartCollide(EntityUid uid, ConveyorComponent component, ref StartCollideEvent args) 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; return;
component.Intersecting.Add(otherUid); component.Intersecting.Add(otherUid);
@@ -60,7 +60,7 @@ public abstract class SharedConveyorController : VirtualController
private void OnConveyorEndCollide(EntityUid uid, ConveyorComponent component, ref EndCollideEvent args) 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) if (component.Intersecting.Count == 0)
RemComp<ActiveConveyorComponent>(uid); RemComp<ActiveConveyorComponent>(uid);

View File

@@ -128,7 +128,7 @@ public sealed class StepTriggerSystem : EntitySystem
private void OnStartCollide(EntityUid uid, StepTriggerComponent component, ref StartCollideEvent args) private void OnStartCollide(EntityUid uid, StepTriggerComponent component, ref StartCollideEvent args)
{ {
var otherUid = args.OtherFixture.Body.Owner; var otherUid = args.OtherEntity;
if (!args.OtherFixture.Hard) if (!args.OtherFixture.Hard)
return; return;
@@ -146,7 +146,7 @@ public sealed class StepTriggerSystem : EntitySystem
private void OnEndCollide(EntityUid uid, StepTriggerComponent component, ref EndCollideEvent args) 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)) if (!component.Colliding.Remove(otherUid))
return; return;

View File

@@ -59,7 +59,7 @@ public abstract class SharedPortalSystem : EntitySystem
if (!ShouldCollide(args.OurFixture, args.OtherFixture)) if (!ShouldCollide(args.OurFixture, args.OtherFixture))
return; return;
var subject = args.OtherFixture.Body.Owner; var subject = args.OtherEntity;
// best not. // best not.
if (Transform(subject).Anchored) if (Transform(subject).Anchored)
@@ -127,7 +127,7 @@ public abstract class SharedPortalSystem : EntitySystem
if (!ShouldCollide(args.OurFixture, args.OtherFixture)) if (!ShouldCollide(args.OurFixture, args.OtherFixture))
return; return;
var subject = args.OtherFixture.Body.Owner; var subject = args.OtherEntity;
// if they came from (not us), remove the timeout // if they came from (not us), remove the timeout
if (TryComp<PortalTimeoutComponent>(subject, out var timeout) && timeout.EnteredPortal != uid) if (TryComp<PortalTimeoutComponent>(subject, out var timeout) && timeout.EnteredPortal != uid)

View File

@@ -74,10 +74,10 @@ namespace Content.Shared.Throwing
return; return;
var thrower = component.Thrower; var thrower = component.Thrower;
var otherBody = args.OtherFixture.Body; if (args.OtherEntity == thrower)
return;
if (otherBody.Owner == thrower) return; ThrowCollideInteraction(thrower, args.OurBody, args.OtherBody);
ThrowCollideInteraction(thrower, args.OurFixture.Body, otherBody);
} }
private void PreventCollision(EntityUid uid, ThrownItemComponent component, ref PreventCollideEvent args) private void PreventCollision(EntityUid uid, ThrownItemComponent component, ref PreventCollideEvent args)