From 735626654a3810ecb5a469d9571a65b85cf9f820 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 23 Aug 2023 18:55:58 +1000 Subject: [PATCH] Remove FixtureId (#19280) --- .../Ranged/Systems/FlyBySoundSystem.cs | 2 +- Content.Server/Anomaly/AnomalySystem.cs | 2 +- .../AtmosphereSystem.HighPressureDelta.cs | 15 +++++++------ .../Atmos/EntitySystems/FlammableSystem.cs | 2 +- Content.Server/Climbing/ClimbSystem.cs | 16 +++++++------- .../EntitySystems/TriggerSystem.Proximity.cs | 5 +++-- .../Explosion/EntitySystems/TriggerSystem.cs | 6 ++--- .../Gatherable/GatherableSystem.Projectile.cs | 2 +- .../Systems/PolymorphSystem.Collide.cs | 2 +- .../Projectiles/ProjectileSystem.cs | 2 +- .../Shuttles/Systems/ShuttleSystem.cs | 4 ++-- .../Shuttles/Systems/ThrusterSystem.cs | 4 ++-- .../EntitySystems/EventHorizonSystem.cs | 2 +- .../Stunnable/Systems/StunOnCollideSystem.cs | 3 ++- .../Tools/Systems/WeldableSystem.cs | 6 ++--- .../SharedMaterialReclaimerSystem.cs | 2 +- .../EntitySystems/SharedCorporealSystem.cs | 12 +++++----- .../EntitySystems/SharedEventHorizonSystem.cs | 22 +++++++------------ .../Standing/StandingStateSystem.cs | 6 ++--- .../SharedEntityStorageSystem.cs | 8 +++---- .../Systems/SharedPortalSystem.cs | 8 +++---- Content.Shared/Throwing/ThrownItemSystem.cs | 2 +- .../Marker/SharedDamageMarkerSystem.cs | 2 +- 23 files changed, 66 insertions(+), 69 deletions(-) diff --git a/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs b/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs index 2372e872cb..4e4df4a156 100644 --- a/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs +++ b/Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs @@ -33,7 +33,7 @@ public sealed class FlyBySoundSystem : SharedFlyBySoundSystem return; } - if (args.OurFixture.ID != FlyByFixture || + if (args.OurFixtureId != FlyByFixture || !_random.Prob(component.Prob)) { return; diff --git a/Content.Server/Anomaly/AnomalySystem.cs b/Content.Server/Anomaly/AnomalySystem.cs index bf103fb0ce..5f6220f386 100644 --- a/Content.Server/Anomaly/AnomalySystem.cs +++ b/Content.Server/Anomaly/AnomalySystem.cs @@ -73,7 +73,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem if (!TryComp(args.OtherEntity, out var particle)) return; - if (args.OtherFixture.ID != particle.FixtureId) + if (args.OtherFixtureId != particle.FixtureId) return; // small function to randomize because it's easier to read like this diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs index e7cb278d13..a06bf3504c 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs @@ -57,9 +57,9 @@ namespace Content.Server.Atmos.EntitySystems if (TryComp(uid, out var fixtures)) { - foreach (var fixture in fixtures.Fixtures.Values) + foreach (var (id, fixture) in fixtures.Fixtures) { - _physics.AddCollisionMask(uid, fixture, (int) CollisionGroup.TableLayer, manager: fixtures); + _physics.AddCollisionMask(uid, id, fixture, (int) CollisionGroup.TableLayer, manager: fixtures); } } } @@ -70,15 +70,16 @@ namespace Content.Server.Atmos.EntitySystems } } - private void AddMobMovedByPressure(MovedByPressureComponent component, PhysicsComponent body) + private void AddMobMovedByPressure(EntityUid uid, MovedByPressureComponent component, PhysicsComponent body) { - if (!TryComp(component.Owner, out var fixtures)) return; + if (!TryComp(uid, out var fixtures)) + return; _physics.SetBodyStatus(body, BodyStatus.InAir); - foreach (var fixture in fixtures.Fixtures.Values) + foreach (var (id, fixture) in fixtures.Fixtures) { - _physics.RemoveCollisionMask(body.Owner, fixture, (int) CollisionGroup.TableLayer, manager: fixtures); + _physics.RemoveCollisionMask(uid, id, fixture, (int) CollisionGroup.TableLayer, manager: fixtures); } // TODO: Make them dynamic type? Ehh but they still want movement so uhh make it non-predicted like weightless? @@ -214,7 +215,7 @@ namespace Content.Server.Atmos.EntitySystems { if (HasComp(uid)) { - AddMobMovedByPressure(component, physics); + AddMobMovedByPressure(uid, component, physics); } if (maxForce > MovedByPressureComponent.ThrowForce) diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index 4c36807a35..2adec63db5 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -135,7 +135,7 @@ namespace Content.Server.Atmos.EntitySystems // 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. - if (args.OtherFixture.ID != FlammableFixtureID && args.OurFixture.ID != FlammableFixtureID) + if (args.OtherFixtureId != FlammableFixtureID && args.OurFixtureId != FlammableFixtureID) return; if (!EntityManager.TryGetComponent(otherUid, out FlammableComponent? otherFlammable)) diff --git a/Content.Server/Climbing/ClimbSystem.cs b/Content.Server/Climbing/ClimbSystem.cs index 8361cda62f..539463eed4 100644 --- a/Content.Server/Climbing/ClimbSystem.cs +++ b/Content.Server/Climbing/ClimbSystem.cs @@ -49,7 +49,7 @@ public sealed class ClimbSystem : SharedClimbSystem private const string ClimbingFixtureName = "climb"; private const int ClimbingCollisionGroup = (int) (CollisionGroup.TableLayer | CollisionGroup.LowImpassable); - private readonly Dictionary> _fixtureRemoveQueue = new(); + private readonly Dictionary> _fixtureRemoveQueue = new(); public override void Initialize() { @@ -212,8 +212,8 @@ public sealed class ClimbSystem : SharedClimbSystem || (fixture.CollisionMask & ClimbingCollisionGroup) == 0) continue; - climbingComp.DisabledFixtureMasks.Add(fixture.ID, fixture.CollisionMask & ClimbingCollisionGroup); - _physics.SetCollisionMask(uid, fixture, fixture.CollisionMask & ~ClimbingCollisionGroup, fixturesComp); + climbingComp.DisabledFixtureMasks.Add(name, fixture.CollisionMask & ClimbingCollisionGroup); + _physics.SetCollisionMask(uid, name, fixture, fixture.CollisionMask & ~ClimbingCollisionGroup, fixturesComp); } if (!_fixtureSystem.TryCreateFixture( @@ -233,7 +233,7 @@ public sealed class ClimbSystem : SharedClimbSystem private void OnClimbEndCollide(EntityUid uid, ClimbingComponent component, ref EndCollideEvent args) { - if (args.OurFixture.ID != ClimbingFixtureName + if (args.OurFixtureId != ClimbingFixtureName || !component.IsClimbing || component.OwnerIsTransitioning) return; @@ -262,18 +262,18 @@ public sealed class ClimbSystem : SharedClimbSystem continue; } - _physics.SetCollisionMask(uid, fixture, fixture.CollisionMask | fixtureMask, fixtures); + _physics.SetCollisionMask(uid, name, fixture, fixture.CollisionMask | fixtureMask, fixtures); } climbing.DisabledFixtureMasks.Clear(); if (!_fixtureRemoveQueue.TryGetValue(uid, out var removeQueue)) { - removeQueue = new List(); + removeQueue = new Dictionary(); _fixtureRemoveQueue.Add(uid, removeQueue); } if (fixtures.Fixtures.TryGetValue(ClimbingFixtureName, out var climbingFixture)) - removeQueue.Add(climbingFixture); + removeQueue.Add(ClimbingFixtureName, climbingFixture); climbing.IsClimbing = false; climbing.OwnerIsTransitioning = false; @@ -440,7 +440,7 @@ public sealed class ClimbSystem : SharedClimbSystem foreach (var fixture in fixtures) { - _fixtureSystem.DestroyFixture(uid, fixture, body: physicsComp, manager: fixturesComp); + _fixtureSystem.DestroyFixture(uid, fixture.Key, fixture.Value, body: physicsComp, manager: fixturesComp); } } diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs index 01d8ea4716..d3d97a851e 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs @@ -61,6 +61,7 @@ public sealed partial class TriggerSystem component.Shape, TriggerOnProximityComponent.FixtureID, hard: false, + body: body, collisionLayer: component.Layer); } @@ -72,7 +73,7 @@ public sealed partial class TriggerSystem private void OnProximityStartCollide(EntityUid uid, TriggerOnProximityComponent component, ref StartCollideEvent args) { - if (args.OurFixture.ID != TriggerOnProximityComponent.FixtureID) + if (args.OurFixtureId != TriggerOnProximityComponent.FixtureID) return; component.Colliding[args.OtherEntity] = args.OtherBody; @@ -80,7 +81,7 @@ public sealed partial class TriggerSystem private static void OnProximityEndCollide(EntityUid uid, TriggerOnProximityComponent component, ref EndCollideEvent args) { - if (args.OurFixture.ID != TriggerOnProximityComponent.FixtureID) + if (args.OurFixtureId != TriggerOnProximityComponent.FixtureID) return; component.Colliding.Remove(args.OtherEntity); diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index 5c0fdea7b6..787aa683fd 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -184,13 +184,13 @@ namespace Content.Server.Explosion.EntitySystems private void OnTriggerCollide(EntityUid uid, TriggerOnCollideComponent component, ref StartCollideEvent args) { - if (args.OurFixture.ID == component.FixtureID && (!component.IgnoreOtherNonHard || args.OtherFixture.Hard)) - Trigger(component.Owner); + if (args.OurFixtureId == component.FixtureID && (!component.IgnoreOtherNonHard || args.OtherFixture.Hard)) + Trigger(uid); } private void OnActivate(EntityUid uid, TriggerOnActivateComponent component, ActivateInWorldEvent args) { - Trigger(component.Owner, args.User); + Trigger(uid, args.User); args.Handled = true; } diff --git a/Content.Server/Gatherable/GatherableSystem.Projectile.cs b/Content.Server/Gatherable/GatherableSystem.Projectile.cs index b8f30a466c..f773ca2dbb 100644 --- a/Content.Server/Gatherable/GatherableSystem.Projectile.cs +++ b/Content.Server/Gatherable/GatherableSystem.Projectile.cs @@ -16,7 +16,7 @@ public sealed partial class GatherableSystem private void OnProjectileCollide(EntityUid uid, GatheringProjectileComponent component, ref StartCollideEvent args) { if (!args.OtherFixture.Hard || - args.OurFixture.ID != SharedProjectileSystem.ProjectileFixture || + args.OurFixtureId != SharedProjectileSystem.ProjectileFixture || component.Amount <= 0 || !TryComp(args.OtherEntity, out var gatherable)) { diff --git a/Content.Server/Polymorph/Systems/PolymorphSystem.Collide.cs b/Content.Server/Polymorph/Systems/PolymorphSystem.Collide.cs index c6a6417efe..46b962b20e 100644 --- a/Content.Server/Polymorph/Systems/PolymorphSystem.Collide.cs +++ b/Content.Server/Polymorph/Systems/PolymorphSystem.Collide.cs @@ -33,7 +33,7 @@ public partial class PolymorphSystem private void OnPolymorphCollide(EntityUid uid, PolymorphOnCollideComponent component, ref StartCollideEvent args) { - if (args.OurFixture.ID != SharedProjectileSystem.ProjectileFixture) + if (args.OurFixtureId != SharedProjectileSystem.ProjectileFixture) return; var other = args.OtherEntity; diff --git a/Content.Server/Projectiles/ProjectileSystem.cs b/Content.Server/Projectiles/ProjectileSystem.cs index 34aa822a6c..8edb2d7ba5 100644 --- a/Content.Server/Projectiles/ProjectileSystem.cs +++ b/Content.Server/Projectiles/ProjectileSystem.cs @@ -30,7 +30,7 @@ public sealed class ProjectileSystem : SharedProjectileSystem private void OnStartCollide(EntityUid uid, ProjectileComponent component, ref StartCollideEvent args) { // This is so entities that shouldn't get a collision are ignored. - if (args.OurFixture.ID != ProjectileFixture || !args.OtherFixture.Hard || component.DamagedEntity) + if (args.OurFixtureId != ProjectileFixture || !args.OtherFixture.Hard || component.DamagedEntity) return; var target = args.OtherEntity; diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.cs index 5fe0bc615d..b99d916b67 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.cs @@ -95,8 +95,8 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem { foreach (var fixture in args.NewFixtures) { - _physics.SetDensity(uid, fixture, TileMassMultiplier, false, manager); - _fixtures.SetRestitution(uid, fixture, 0.1f, false, manager); + _physics.SetDensity(uid, fixture.Key, fixture.Value, TileMassMultiplier, false, manager); + _fixtures.SetRestitution(uid, fixture.Key, fixture.Value, 0.1f, false, manager); } } diff --git a/Content.Server/Shuttles/Systems/ThrusterSystem.cs b/Content.Server/Shuttles/Systems/ThrusterSystem.cs index dacec415e5..a9bc0f4e71 100644 --- a/Content.Server/Shuttles/Systems/ThrusterSystem.cs +++ b/Content.Server/Shuttles/Systems/ThrusterSystem.cs @@ -445,7 +445,7 @@ public sealed class ThrusterSystem : EntitySystem private void OnStartCollide(EntityUid uid, ThrusterComponent component, ref StartCollideEvent args) { - if (args.OurFixture.ID != BurnFixture) + if (args.OurFixtureId != BurnFixture) return; component.Colliding.Add(args.OtherEntity); @@ -453,7 +453,7 @@ public sealed class ThrusterSystem : EntitySystem private void OnEndCollide(EntityUid uid, ThrusterComponent component, ref EndCollideEvent args) { - if (args.OurFixture.ID != BurnFixture) + if (args.OurFixtureId != BurnFixture) return; component.Colliding.Remove(args.OtherEntity); diff --git a/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs b/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs index cca68ccc5e..470dcb43a5 100644 --- a/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs +++ b/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs @@ -398,7 +398,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem { if (comp.BeingConsumedByAnotherEventHorizon) return; - if (args.OurFixture.ID != comp.ConsumerFixtureId) + if (args.OurFixtureId != comp.ConsumerFixtureId) return; AttemptConsumeEntity(uid, args.OtherEntity, comp); diff --git a/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs b/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs index f2ddbcf803..52e3cab79c 100644 --- a/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs +++ b/Content.Server/Stunnable/Systems/StunOnCollideSystem.cs @@ -36,7 +36,8 @@ namespace Content.Server.Stunnable } private void HandleCollide(EntityUid uid, StunOnCollideComponent component, ref StartCollideEvent args) { - if (args.OurFixture.ID != component.FixtureID) return; + if (args.OurFixtureId != component.FixtureID) + return; TryDoCollideStun(uid, component, args.OtherEntity); } diff --git a/Content.Server/Tools/Systems/WeldableSystem.cs b/Content.Server/Tools/Systems/WeldableSystem.cs index e42f1f9104..154c3ddffa 100644 --- a/Content.Server/Tools/Systems/WeldableSystem.cs +++ b/Content.Server/Tools/Systems/WeldableSystem.cs @@ -114,16 +114,16 @@ public sealed class WeldableSystem : EntitySystem if (!TryComp(uid, out var fixtures)) return; - foreach (var fixture in fixtures.Fixtures.Values) + foreach (var (id, fixture) in fixtures.Fixtures) { switch (args.IsWelded) { case true when fixture.CollisionLayer == (int) component.UnWeldedLayer: - _physics.SetCollisionLayer(uid, fixture, (int) component.WeldedLayer); + _physics.SetCollisionLayer(uid, id, fixture, (int) component.WeldedLayer); break; case false when fixture.CollisionLayer == (int) component.WeldedLayer: - _physics.SetCollisionLayer(uid, fixture, (int) component.UnWeldedLayer); + _physics.SetCollisionLayer(uid, id, fixture, (int) component.UnWeldedLayer); break; } } diff --git a/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs b/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs index e6e511f875..e050e67c3d 100644 --- a/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs +++ b/Content.Shared/Materials/SharedMaterialReclaimerSystem.cs @@ -83,7 +83,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem private void OnCollide(EntityUid uid, CollideMaterialReclaimerComponent component, ref StartCollideEvent args) { - if (args.OurFixture.ID != component.FixtureId) + if (args.OurFixtureId != component.FixtureId) return; if (!TryComp(uid, out var reclaimer)) return; diff --git a/Content.Shared/Revenant/EntitySystems/SharedCorporealSystem.cs b/Content.Shared/Revenant/EntitySystems/SharedCorporealSystem.cs index 70b3820796..e86fdb8e80 100644 --- a/Content.Shared/Revenant/EntitySystems/SharedCorporealSystem.cs +++ b/Content.Shared/Revenant/EntitySystems/SharedCorporealSystem.cs @@ -38,10 +38,10 @@ public abstract class SharedCorporealSystem : EntitySystem if (TryComp(uid, out var fixtures) && fixtures.FixtureCount >= 1) { - var fixture = fixtures.Fixtures.Values.First(); + var fixture = fixtures.Fixtures.First(); - _physics.SetCollisionMask(uid, fixture, (int) (CollisionGroup.SmallMobMask | CollisionGroup.GhostImpassable), fixtures); - _physics.SetCollisionLayer(uid, fixture, (int) CollisionGroup.SmallMobLayer, fixtures); + _physics.SetCollisionMask(uid, fixture.Key, fixture.Value, (int) (CollisionGroup.SmallMobMask | CollisionGroup.GhostImpassable), fixtures); + _physics.SetCollisionLayer(uid, fixture.Key, fixture.Value, (int) CollisionGroup.SmallMobLayer, fixtures); } _movement.RefreshMovementSpeedModifiers(uid); } @@ -52,10 +52,10 @@ public abstract class SharedCorporealSystem : EntitySystem if (TryComp(uid, out var fixtures) && fixtures.FixtureCount >= 1) { - var fixture = fixtures.Fixtures.Values.First(); + var fixture = fixtures.Fixtures.First(); - _physics.SetCollisionMask(uid, fixture, (int) CollisionGroup.GhostImpassable, fixtures); - _physics.SetCollisionLayer(uid, fixture, 0, fixtures); + _physics.SetCollisionMask(uid, fixture.Key, fixture.Value, (int) CollisionGroup.GhostImpassable, fixtures); + _physics.SetCollisionLayer(uid, fixture.Key, fixture.Value, 0, fixtures); } component.MovementSpeedDebuff = 1; //just so we can avoid annoying code elsewhere _movement.RefreshMovementSpeedModifiers(uid); diff --git a/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs b/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs index dcc83946a2..4b39ef50e7 100644 --- a/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs +++ b/Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs @@ -158,24 +158,18 @@ public abstract class SharedEventHorizonSystem : EntitySystem return; // Update both fixtures the event horizon is associated with: - if (consumerId != null) + var consumer = _fixtures.GetFixtureOrNull(uid, consumerId, fixtures); + if (consumer != null) { - var consumer = _fixtures.GetFixtureOrNull(uid, consumerId, fixtures); - if (consumer != null) - { - _physics.SetRadius(uid, consumer, consumer.Shape, eventHorizon.Radius, fixtures); - _physics.SetHard(uid, consumer, false, fixtures); - } + _physics.SetRadius(uid, consumerId, consumer, consumer.Shape, eventHorizon.Radius, fixtures); + _physics.SetHard(uid, consumer, false, fixtures); } - if (colliderId != null) + var collider = _fixtures.GetFixtureOrNull(uid, colliderId, fixtures); + if (collider != null) { - var collider = _fixtures.GetFixtureOrNull(uid, colliderId, fixtures); - if (collider != null) - { - _physics.SetRadius(uid, collider, collider.Shape, eventHorizon.Radius, fixtures); - _physics.SetHard(uid, collider, true, fixtures); - } + _physics.SetRadius(uid, colliderId, collider, collider.Shape, eventHorizon.Radius, fixtures); + _physics.SetHard(uid, collider, true, fixtures); } EntityManager.Dirty(uid, fixtures); diff --git a/Content.Shared/Standing/StandingStateSystem.cs b/Content.Shared/Standing/StandingStateSystem.cs index b09be24aba..2716ed02df 100644 --- a/Content.Shared/Standing/StandingStateSystem.cs +++ b/Content.Shared/Standing/StandingStateSystem.cs @@ -92,7 +92,7 @@ namespace Content.Shared.Standing continue; standingState.ChangedFixtures.Add(key); - _physics.SetCollisionMask(uid, fixture, fixture.CollisionMask & ~StandingCollisionLayer, manager: fixtureComponent); + _physics.SetCollisionMask(uid, key, fixture, fixture.CollisionMask & ~StandingCollisionLayer, manager: fixtureComponent); } } @@ -134,7 +134,7 @@ namespace Content.Shared.Standing } standingState.Standing = true; - Dirty(standingState); + Dirty(uid, standingState); RaiseLocalEvent(uid, new StoodEvent(), false); _appearance.SetData(uid, RotationVisuals.RotationState, RotationState.Vertical, appearance); @@ -144,7 +144,7 @@ namespace Content.Shared.Standing foreach (var key in standingState.ChangedFixtures) { if (fixtureComponent.Fixtures.TryGetValue(key, out var fixture)) - _physics.SetCollisionMask(uid, fixture, fixture.CollisionMask | StandingCollisionLayer, fixtureComponent); + _physics.SetCollisionMask(uid, key, fixture, fixture.CollisionMask | StandingCollisionLayer, fixtureComponent); } } standingState.ChangedFixtures.Clear(); diff --git a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs index 8ea40f525c..d5100fe585 100644 --- a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs @@ -429,17 +429,17 @@ public abstract class SharedEntityStorageSystem : EntitySystem // RemovedMasks needs to be tracked separately for each fixture, using a fixture Id Dictionary. Also the // fixture IDs probably cant be automatically generated without causing issues, unless there is some // guarantee that they will get deserialized with the same auto-generated ID when saving+loading the map. - var fixture = fixtures.Fixtures.Values.First(); + var fixture = fixtures.Fixtures.First(); if (component.Open) { - component.RemovedMasks = fixture.CollisionLayer & component.MasksToRemove; - _physics.SetCollisionLayer(uid, fixture, fixture.CollisionLayer & ~component.MasksToRemove, + component.RemovedMasks = fixture.Value.CollisionLayer & component.MasksToRemove; + _physics.SetCollisionLayer(uid, fixture.Key, fixture.Value, fixture.Value.CollisionLayer & ~component.MasksToRemove, manager: fixtures); } else { - _physics.SetCollisionLayer(uid, fixture, fixture.CollisionLayer | component.RemovedMasks, + _physics.SetCollisionLayer(uid, fixture.Key, fixture.Value, fixture.Value.CollisionLayer | component.RemovedMasks, manager: fixtures); component.RemovedMasks = 0; } diff --git a/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs b/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs index 59c6eee604..503b77d6ae 100644 --- a/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs +++ b/Content.Shared/Teleportation/Systems/SharedPortalSystem.cs @@ -88,16 +88,16 @@ public abstract class SharedPortalSystem : EntitySystem component.EnteredPortal = state.EnteredPortal; } - private bool ShouldCollide(Fixture our, Fixture other) + private bool ShouldCollide(string ourId, string otherId, Fixture our, Fixture other) { // most non-hard fixtures shouldn't pass through portals, but projectiles are non-hard as well // and they should still pass through - return our.ID == PortalFixture && (other.Hard || other.ID == ProjectileFixture); + return ourId == PortalFixture && (other.Hard || otherId == ProjectileFixture); } private void OnCollide(EntityUid uid, PortalComponent component, ref StartCollideEvent args) { - if (!ShouldCollide(args.OurFixture, args.OtherFixture)) + if (!ShouldCollide(args.OurFixtureId, args.OtherFixtureId, args.OurFixture, args.OtherFixture)) return; var subject = args.OtherEntity; @@ -163,7 +163,7 @@ public abstract class SharedPortalSystem : EntitySystem private void OnEndCollide(EntityUid uid, PortalComponent component, ref EndCollideEvent args) { - if (!ShouldCollide(args.OurFixture, args.OtherFixture)) + if (!ShouldCollide(args.OurFixtureId, args.OtherFixtureId,args.OurFixture, args.OtherFixture)) return; var subject = args.OtherEntity; diff --git a/Content.Shared/Throwing/ThrownItemSystem.cs b/Content.Shared/Throwing/ThrownItemSystem.cs index c2ec72cfcb..8ff068bde1 100644 --- a/Content.Shared/Throwing/ThrownItemSystem.cs +++ b/Content.Shared/Throwing/ThrownItemSystem.cs @@ -111,7 +111,7 @@ namespace Content.Shared.Throwing if (fixture != null) { - _fixtures.DestroyFixture(uid, fixture, manager: manager); + _fixtures.DestroyFixture(uid, ThrowingFixture, fixture, manager: manager); } } diff --git a/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs b/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs index 4c8ed2f8a7..7289b232dc 100644 --- a/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs +++ b/Content.Shared/Weapons/Marker/SharedDamageMarkerSystem.cs @@ -60,7 +60,7 @@ public abstract class SharedDamageMarkerSystem : EntitySystem private void OnMarkerCollide(EntityUid uid, DamageMarkerOnCollideComponent component, ref StartCollideEvent args) { if (!args.OtherFixture.Hard || - args.OurFixture.ID != SharedProjectileSystem.ProjectileFixture || + args.OurFixtureId != SharedProjectileSystem.ProjectileFixture || component.Amount <= 0 || component.Whitelist?.IsValid(args.OtherEntity, EntityManager) == false || !TryComp(uid, out var projectile) ||