diff --git a/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs b/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs index b1e07e9415..1c29cc2872 100644 --- a/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs +++ b/Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs @@ -75,7 +75,7 @@ namespace Content.Client.GameObjects.Components.Suspicion } // all entities have a TransformComponent - var transform = physics.Entity.Transform; + var transform = physics.Owner.Transform; // if not on the same map, continue if (transform.MapID != _eyeManager.CurrentMap || !transform.IsMapTransform) diff --git a/Content.Server/Atmos/TileAtmosphere.cs b/Content.Server/Atmos/TileAtmosphere.cs index dbc606bab2..a9f709ffb6 100644 --- a/Content.Server/Atmos/TileAtmosphere.cs +++ b/Content.Server/Atmos/TileAtmosphere.cs @@ -160,7 +160,7 @@ namespace Content.Server.Atmos || entity.IsInContainer()) continue; - var pressureMovements = physics.Entity.EnsureComponent(); + var pressureMovements = physics.Owner.EnsureComponent(); if (pressure.LastHighPressureMovementAirCycle < _gridAtmosphereComponent.UpdateCounter) { pressureMovements.ExperiencePressureDifference(_gridAtmosphereComponent.UpdateCounter, PressureDifference, _pressureDirection, 0, PressureSpecificTarget?.GridIndices.ToEntityCoordinates(GridIndex, _mapManager) ?? EntityCoordinates.Invalid); diff --git a/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs b/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs index 5030ae5647..1698a6d178 100644 --- a/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/FlammableComponent.cs @@ -19,6 +19,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Localization; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -144,9 +145,9 @@ namespace Content.Server.GameObjects.Components.Atmos } } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - if (!otherBody.Entity.TryGetComponent(out FlammableComponent? otherFlammable)) + if (!otherFixture.Body.Owner.TryGetComponent(out FlammableComponent? otherFlammable)) return; if (!FireSpread || !otherFlammable.FireSpread) diff --git a/Content.Server/GameObjects/Components/Chemistry/VaporComponent.cs b/Content.Server/GameObjects/Components/Chemistry/VaporComponent.cs index d8e3d8b03f..6539a5da0d 100644 --- a/Content.Server/GameObjects/Components/Chemistry/VaporComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/VaporComponent.cs @@ -9,6 +9,7 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -114,15 +115,15 @@ namespace Content.Server.GameObjects.Components.Chemistry return true; } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { if (!Owner.TryGetComponent(out SolutionContainerComponent? contents)) return; - contents.Solution.DoEntityReaction(otherBody.Entity, ReactionMethod.Touch); + contents.Solution.DoEntityReaction(otherFixture.Body.Owner, ReactionMethod.Touch); // Check for collision with a impassable object (e.g. wall) and stop - if ((otherBody.CollisionLayer & (int) CollisionGroup.Impassable) != 0 && otherBody.Hard) + if ((otherFixture.CollisionLayer & (int) CollisionGroup.Impassable) != 0 && otherFixture.Hard) { Owner.Delete(); } diff --git a/Content.Server/GameObjects/Components/Damage/DamageOnHighSpeedImpactComponent.cs b/Content.Server/GameObjects/Components/Damage/DamageOnHighSpeedImpactComponent.cs index bbc04a818f..cdcb341637 100644 --- a/Content.Server/GameObjects/Components/Damage/DamageOnHighSpeedImpactComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/DamageOnHighSpeedImpactComponent.cs @@ -9,6 +9,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Serialization.Manager.Attributes; @@ -44,16 +45,16 @@ namespace Content.Server.GameObjects.Components.Damage public float DamageCooldown { get; set; } = 2f; private TimeSpan _lastHit = TimeSpan.Zero; - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { if (!Owner.TryGetComponent(out IDamageableComponent? damageable)) return; - var speed = ourBody.LinearVelocity.Length; + var speed = ourFixture.Body.LinearVelocity.Length; if (speed < MinimumSpeed) return; if (!string.IsNullOrEmpty(SoundHit)) - SoundSystem.Play(Filter.Pvs(otherBody.Entity), SoundHit, otherBody.Entity, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f)); + SoundSystem.Play(Filter.Pvs(otherFixture.Body.Owner), SoundHit, otherFixture.Body.Owner, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f)); if ((_gameTiming.CurTime - _lastHit).TotalSeconds < DamageCooldown) return; @@ -65,7 +66,7 @@ namespace Content.Server.GameObjects.Components.Damage if (Owner.TryGetComponent(out StunnableComponent? stun) && _robustRandom.Prob(StunChance)) stun.Stun(StunSeconds); - damageable.ChangeDamage(Damage, damage, false, otherBody.Entity); + damageable.ChangeDamage(Damage, damage, false, otherFixture.Body.Owner); } } } diff --git a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs index ad7927b81b..ed4b7a63af 100644 --- a/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs +++ b/Content.Server/GameObjects/Components/Doors/ServerDoorComponent.cs @@ -34,6 +34,7 @@ using Robust.Shared.ViewVariables; using Timer = Robust.Shared.Timing.Timer; using Content.Server.GameObjects.Components.Construction; using Robust.Shared.Containers; +using Robust.Shared.Physics.Dynamics; namespace Content.Server.GameObjects.Components.Doors { @@ -215,7 +216,7 @@ namespace Content.Server.GameObjects.Components.Doors } } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { if (State != DoorState.Closed) { @@ -229,9 +230,9 @@ namespace Content.Server.GameObjects.Components.Doors // Disabled because it makes it suck hard to walk through double doors. - if (otherBody.Entity.HasComponent()) + if (otherFixture.Body.Owner.HasComponent()) { - if (!otherBody.Entity.TryGetComponent(out var mover)) return; + if (!otherFixture.Body.Owner.TryGetComponent(out var mover)) return; /* // TODO: temporary hack to fix the physics system raising collision events akwardly. @@ -244,7 +245,7 @@ namespace Content.Server.GameObjects.Components.Doors TryOpen(entity); */ - TryOpen(otherBody.Entity); + TryOpen(otherFixture.Body.Owner); } } @@ -430,7 +431,7 @@ namespace Content.Server.GameObjects.Components.Doors var broadPhaseSystem = EntitySystem.Get(); // Use this version so we can ignore the CanCollide being false - foreach(var e in broadPhaseSystem.GetCollidingEntities(physicsComponent.Entity.Transform.MapID, physicsComponent.GetWorldAABB())) + foreach(var e in broadPhaseSystem.GetCollidingEntities(physicsComponent.Owner.Transform.MapID, physicsComponent.GetWorldAABB())) { if ((physicsComponent.CollisionMask & e.CollisionLayer) != 0 && broadPhaseSystem.IntersectionPercent(physicsComponent, e) > 0.01f) return true; } @@ -510,8 +511,8 @@ namespace Content.Server.GameObjects.Components.Doors // Crush foreach (var e in collidingentities) { - if (!e.Entity.TryGetComponent(out StunnableComponent? stun) - || !e.Entity.TryGetComponent(out IDamageableComponent? damage)) + if (!e.Owner.TryGetComponent(out StunnableComponent? stun) + || !e.Owner.TryGetComponent(out IDamageableComponent? damage)) { continue; } @@ -522,7 +523,7 @@ namespace Content.Server.GameObjects.Components.Doors continue; hitsomebody = true; - CurrentlyCrushing.Add(e.Entity.Uid); + CurrentlyCrushing.Add(e.Owner.Uid); damage.ChangeDamage(DamageType.Blunt, DoorCrushDamage, false, Owner); stun.Paralyze(DoorStunTime); diff --git a/Content.Server/GameObjects/Components/PA/ParticleProjectileComponent.cs b/Content.Server/GameObjects/Components/PA/ParticleProjectileComponent.cs index 01578de9bd..61e3e92497 100644 --- a/Content.Server/GameObjects/Components/PA/ParticleProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/PA/ParticleProjectileComponent.cs @@ -8,6 +8,7 @@ using Robust.Shared.Log; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Timing; namespace Content.Server.GameObjects.Components.PA @@ -17,9 +18,9 @@ namespace Content.Server.GameObjects.Components.PA { public override string Name => "ParticleProjectile"; private ParticleAcceleratorPowerState _state; - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - if (otherBody.Entity.TryGetComponent(out var singularityComponent)) + if (otherFixture.Body.Owner.TryGetComponent(out var singularityComponent)) { var multiplier = _state switch { @@ -33,7 +34,7 @@ namespace Content.Server.GameObjects.Components.PA singularityComponent.Energy += 10 * multiplier; Owner.Delete(); } - else if (otherBody.Entity.TryGetComponent(out var singularityGeneratorComponent)) + else if (otherFixture.Body.Owner.TryGetComponent(out var singularityGeneratorComponent)) { singularityGeneratorComponent.Power += _state switch { diff --git a/Content.Server/GameObjects/Components/Portal/PortalComponent.cs b/Content.Server/GameObjects/Components/Portal/PortalComponent.cs index b098888c18..45592a48c0 100644 --- a/Content.Server/GameObjects/Components/Portal/PortalComponent.cs +++ b/Content.Server/GameObjects/Components/Portal/PortalComponent.cs @@ -9,6 +9,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -156,11 +157,11 @@ namespace Content.Server.GameObjects.Components.Portal StartCooldown(); } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { if (_onCooldown == false) { - TryPortalEntity(otherBody.Entity); + TryPortalEntity(otherFixture.Body.Owner); } } } diff --git a/Content.Server/GameObjects/Components/Projectiles/ChemicalInjectionProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ChemicalInjectionProjectileComponent.cs index 54e09659d2..6054031c9f 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ChemicalInjectionProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ChemicalInjectionProjectileComponent.cs @@ -5,6 +5,7 @@ using Content.Shared.Chemistry; using Robust.Shared.GameObjects; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -33,9 +34,9 @@ namespace Content.Server.GameObjects.Components.Projectiles _solutionContainer = Owner.EnsureComponent(); } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - if (!otherBody.Entity.TryGetComponent(out var bloodstream)) + if (!otherFixture.Body.Owner.TryGetComponent(out var bloodstream)) return; var solution = _solutionContainer.Solution; diff --git a/Content.Server/GameObjects/Components/Projectiles/ExplosiveProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ExplosiveProjectileComponent.cs index fb7acc3289..74e1c3ba37 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ExplosiveProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ExplosiveProjectileComponent.cs @@ -2,6 +2,7 @@ using Content.Server.GameObjects.Components.Explosion; using Robust.Shared.GameObjects; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; namespace Content.Server.GameObjects.Components.Projectiles { @@ -17,7 +18,7 @@ namespace Content.Server.GameObjects.Components.Projectiles Owner.EnsureComponent(); } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { if (Owner.TryGetComponent(out ExplosiveComponent? explosive)) { diff --git a/Content.Server/GameObjects/Components/Projectiles/FlashProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/FlashProjectileComponent.cs index a550156112..873eb7880e 100644 --- a/Content.Server/GameObjects/Components/Projectiles/FlashProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/FlashProjectileComponent.cs @@ -3,6 +3,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Projectiles @@ -29,12 +30,9 @@ namespace Content.Server.GameObjects.Components.Projectiles Owner.EnsureComponent(); } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - if (_flashed) - { - return; - } + if (_flashed) return; FlashableComponent.FlashAreaHelper(Owner, _range, _duration); _flashed = true; diff --git a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs index 47f5b06fcc..a94c202e8a 100644 --- a/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/ProjectileComponent.cs @@ -8,6 +8,7 @@ using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; using Robust.Shared.Players; using Robust.Shared.Serialization.Manager.Attributes; @@ -57,17 +58,17 @@ namespace Content.Server.GameObjects.Components.Projectiles /// /// Applies the damage when our projectile collides with its victim /// - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { // This is so entities that shouldn't get a collision are ignored. - if (!otherBody.Hard || _damagedEntity) + if (!otherFixture.Hard || _damagedEntity) { return; } - var coordinates = otherBody.Entity.Transform.Coordinates; + var coordinates = otherFixture.Body.Owner.Transform.Coordinates; var playerFilter = Filter.Pvs(coordinates); - if (otherBody.Entity.TryGetComponent(out IDamageableComponent? damage) && _soundHitSpecies != null) + if (otherFixture.Body.Owner.TryGetComponent(out IDamageableComponent? damage) && _soundHitSpecies != null) { SoundSystem.Play(playerFilter, _soundHitSpecies, coordinates); } @@ -89,9 +90,9 @@ namespace Content.Server.GameObjects.Components.Projectiles } // Damaging it can delete it - if (!otherBody.Entity.Deleted && otherBody.Entity.TryGetComponent(out CameraRecoilComponent? recoilComponent)) + if (!otherFixture.Body.Deleted && otherFixture.Body.Owner.TryGetComponent(out CameraRecoilComponent? recoilComponent)) { - var direction = ourBody.LinearVelocity.Normalized; + var direction = ourFixture.Body.LinearVelocity.Normalized; recoilComponent.Kick(direction); } diff --git a/Content.Server/GameObjects/Components/Projectiles/StunnableProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/StunnableProjectileComponent.cs index 9d33ab07cb..c0192750cd 100644 --- a/Content.Server/GameObjects/Components/Projectiles/StunnableProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/StunnableProjectileComponent.cs @@ -2,6 +2,7 @@ using Content.Server.GameObjects.Components.Mobs; using Robust.Shared.GameObjects; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Server.GameObjects.Components.Projectiles @@ -29,9 +30,9 @@ namespace Content.Server.GameObjects.Components.Projectiles Owner.EnsureComponentWarn(out ProjectileComponent _); } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - if (otherBody.Entity.TryGetComponent(out StunnableComponent? stunnableComponent)) + if (otherFixture.Body.Owner.TryGetComponent(out StunnableComponent? stunnableComponent)) { stunnableComponent.Stun(_stunAmount); stunnableComponent.Knockdown(_knockdownAmount); diff --git a/Content.Server/GameObjects/Components/Pulling/PullableComponent.cs b/Content.Server/GameObjects/Components/Pulling/PullableComponent.cs index 9c55176d5d..0ff691c2e9 100644 --- a/Content.Server/GameObjects/Components/Pulling/PullableComponent.cs +++ b/Content.Server/GameObjects/Components/Pulling/PullableComponent.cs @@ -40,7 +40,7 @@ namespace Content.Server.GameObjects.Components.Pulling } data.Visibility = VerbVisibility.Visible; - data.Text = component.Puller == userPhysics.Entity + data.Text = component.Puller == userPhysics.Owner ? Loc.GetString("Stop pulling") : Loc.GetString("Pull"); } diff --git a/Content.Server/GameObjects/Components/Recycling/RecyclerComponent.cs b/Content.Server/GameObjects/Components/Recycling/RecyclerComponent.cs index ea9c13d542..d5eac07a18 100644 --- a/Content.Server/GameObjects/Components/Recycling/RecyclerComponent.cs +++ b/Content.Server/GameObjects/Components/Recycling/RecyclerComponent.cs @@ -19,6 +19,7 @@ using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -140,9 +141,9 @@ namespace Content.Server.GameObjects.Components.Recycling return true; } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - Recycle(otherBody.Entity); + Recycle(otherFixture.Body.Owner); } SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat) diff --git a/Content.Server/GameObjects/Components/Singularity/ContainmentFieldComponent.cs b/Content.Server/GameObjects/Components/Singularity/ContainmentFieldComponent.cs index e841b09530..96d9df2b10 100644 --- a/Content.Server/GameObjects/Components/Singularity/ContainmentFieldComponent.cs +++ b/Content.Server/GameObjects/Components/Singularity/ContainmentFieldComponent.cs @@ -2,6 +2,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; namespace Content.Server.GameObjects.Components.Singularity { @@ -11,7 +12,7 @@ namespace Content.Server.GameObjects.Components.Singularity public override string Name => "ContainmentField"; public ContainmentFieldConnection? Parent; - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { if (Parent == null) { @@ -19,7 +20,7 @@ namespace Content.Server.GameObjects.Components.Singularity return; } - Parent.TryRepell(Owner, otherBody.Entity); + Parent.TryRepell(Owner, otherFixture.Body.Owner); } } } diff --git a/Content.Server/GameObjects/Components/Singularity/ContainmentFieldGeneratorComponent.cs b/Content.Server/GameObjects/Components/Singularity/ContainmentFieldGeneratorComponent.cs index 66f45fe331..b4afa98712 100644 --- a/Content.Server/GameObjects/Components/Singularity/ContainmentFieldGeneratorComponent.cs +++ b/Content.Server/GameObjects/Components/Singularity/ContainmentFieldGeneratorComponent.cs @@ -13,6 +13,7 @@ using Robust.Shared.Physics.Broadphase; using Robust.Shared.ViewVariables; using Robust.Server.GameObjects; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; namespace Content.Server.GameObjects.Components.Singularity { @@ -177,9 +178,9 @@ namespace Content.Server.GameObjects.Components.Singularity } } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - if(otherBody.Entity.HasTag("EmitterBolt")) { + if(otherFixture.Body.Owner.HasTag("EmitterBolt")) { ReceivePower(4); } } diff --git a/Content.Server/GameObjects/Components/Singularity/ServerSingularityComponent.cs b/Content.Server/GameObjects/Components/Singularity/ServerSingularityComponent.cs index 242c162a80..6572168619 100644 --- a/Content.Server/GameObjects/Components/Singularity/ServerSingularityComponent.cs +++ b/Content.Server/GameObjects/Components/Singularity/ServerSingularityComponent.cs @@ -10,6 +10,7 @@ using Robust.Shared.Map; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; using Robust.Shared.Players; using Robust.Shared.Timing; @@ -121,13 +122,13 @@ namespace Content.Server.GameObjects.Components.Singularity Energy -= EnergyDrain * seconds; } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - var otherEntity = otherBody.Entity; + var otherEntity = otherFixture.Body.Owner; if (otherEntity.TryGetComponent(out var mapGridComponent)) { - foreach (var tile in mapGridComponent.Grid.GetTilesIntersecting(ourBody.GetWorldAABB())) + foreach (var tile in mapGridComponent.Grid.GetTilesIntersecting(ourFixture.Body.GetWorldAABB())) { mapGridComponent.Grid.SetTile(tile.GridIndices, Tile.Empty); Energy++; diff --git a/Content.Shared/GameObjects/Components/Buckle/SharedBuckleComponent.cs b/Content.Shared/GameObjects/Components/Buckle/SharedBuckleComponent.cs index 7afcd41e82..5501c89513 100644 --- a/Content.Shared/GameObjects/Components/Buckle/SharedBuckleComponent.cs +++ b/Content.Shared/GameObjects/Components/Buckle/SharedBuckleComponent.cs @@ -43,7 +43,7 @@ namespace Content.Shared.GameObjects.Components.Buckle bool ICollideSpecial.PreventCollide(IPhysBody collidedwith) { - if (collidedwith.Entity.Uid == LastEntityBuckledTo) + if (collidedwith.Owner.Uid == LastEntityBuckledTo) { IsOnStrapEntityThisFrame = true; return Buckled || DontCollide; diff --git a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs index d2fae33c02..0f83411a3e 100644 --- a/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs +++ b/Content.Shared/GameObjects/Components/Disposal/SharedDisposalUnitComponent.cs @@ -75,14 +75,14 @@ namespace Content.Shared.GameObjects.Components.Disposal bool ICollideSpecial.PreventCollide(IPhysBody collided) { - if (IsExiting(collided.Entity)) return true; + if (IsExiting(collided.Owner)) return true; if (!Owner.TryGetComponent(out IContainerManager? manager)) return false; - if (manager.ContainsEntity(collided.Entity)) + if (manager.ContainsEntity(collided.Owner)) { - if (!_intersecting.Contains(collided.Entity)) + if (!_intersecting.Contains(collided.Owner)) { - _intersecting.Add(collided.Entity); + _intersecting.Add(collided.Owner); } return true; } diff --git a/Content.Shared/GameObjects/Components/Doors/SharedDoorComponent.cs b/Content.Shared/GameObjects/Components/Doors/SharedDoorComponent.cs index 2f4f13b73e..94dd75340d 100644 --- a/Content.Shared/GameObjects/Components/Doors/SharedDoorComponent.cs +++ b/Content.Shared/GameObjects/Components/Doors/SharedDoorComponent.cs @@ -102,7 +102,7 @@ namespace Content.Shared.GameObjects.Components.Doors // stops us colliding with people we're crushing, to prevent hitbox clipping and jank public bool PreventCollide(IPhysBody collidedwith) { - return CurrentlyCrushing.Contains(collidedwith.Entity.Uid); + return CurrentlyCrushing.Contains(collidedwith.Owner.Uid); } /// diff --git a/Content.Shared/GameObjects/Components/Items/ThrownItemComponent.cs b/Content.Shared/GameObjects/Components/Items/ThrownItemComponent.cs index 727fe326dc..f96b7aaad5 100644 --- a/Content.Shared/GameObjects/Components/Items/ThrownItemComponent.cs +++ b/Content.Shared/GameObjects/Components/Items/ThrownItemComponent.cs @@ -18,15 +18,15 @@ namespace Content.Shared.GameObjects.Components.Items private Fixture? _fixture; - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) { - if (otherBody.Entity == Thrower) return; - EntitySystem.Get().ThrowCollideInteraction(Thrower, ourBody, otherBody); + if (otherFixture.Body.Owner == Thrower) return; + EntitySystem.Get().ThrowCollideInteraction(Thrower, ourFixture.Body, otherFixture.Body); } bool ICollideSpecial.PreventCollide(IPhysBody collidedwith) { - return collidedwith.Entity == Thrower; + return collidedwith.Owner == Thrower; } void IThrown.Thrown(ThrownEventArgs eventArgs) diff --git a/Content.Shared/GameObjects/Components/Movement/SlipperyComponent.cs b/Content.Shared/GameObjects/Components/Movement/SlipperyComponent.cs index c8f3045022..f99761e599 100644 --- a/Content.Shared/GameObjects/Components/Movement/SlipperyComponent.cs +++ b/Content.Shared/GameObjects/Components/Movement/SlipperyComponent.cs @@ -13,6 +13,7 @@ using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; using Robust.Shared.Players; using Robust.Shared.Serialization; @@ -153,8 +154,8 @@ namespace Content.Shared.GameObjects.Components.Movement { if (!Slippery || Owner.IsInContainer() - || _slipped.Contains(otherBody.Entity.Uid) - || !otherBody.Entity.TryGetComponent(out SharedStunnableComponent? stun)) + || _slipped.Contains(otherBody.Owner.Uid) + || !otherBody.Owner.TryGetComponent(out SharedStunnableComponent? stun)) { return false; } @@ -171,7 +172,7 @@ namespace Content.Shared.GameObjects.Components.Movement return false; } - if (!EffectBlockerSystem.CanSlip(otherBody.Entity)) + if (!EffectBlockerSystem.CanSlip(otherBody.Owner)) { return false; } @@ -179,7 +180,7 @@ namespace Content.Shared.GameObjects.Components.Movement otherBody.LinearVelocity *= LaunchForwardsMultiplier; stun.Paralyze(5); - _slipped.Add(otherBody.Entity.Uid); + _slipped.Add(otherBody.Owner.Uid); Dirty(); if (!string.IsNullOrEmpty(SlipSound) && _moduleManager.IsServerModule) @@ -190,9 +191,9 @@ namespace Content.Shared.GameObjects.Components.Movement return true; } - void IStartCollide.CollideWith(IPhysBody ourBody, IPhysBody otherBody, in Manifold manifold) + void IStartCollide.CollideWith(Fixture _, Fixture otherFixture, in Manifold manifold) { - _colliding.Add(otherBody.Owner.Uid); + _colliding.Add(otherFixture.Body.Owner.Uid); } public void Update() diff --git a/Content.Shared/GameObjects/Components/Projectiles/SharedProjectileComponent.cs b/Content.Shared/GameObjects/Components/Projectiles/SharedProjectileComponent.cs index 82ecff0ff7..a5938e482d 100644 --- a/Content.Shared/GameObjects/Components/Projectiles/SharedProjectileComponent.cs +++ b/Content.Shared/GameObjects/Components/Projectiles/SharedProjectileComponent.cs @@ -41,7 +41,7 @@ namespace Content.Shared.GameObjects.Components.Projectiles public bool PreventCollide(IPhysBody collidedwith) { - return IgnoreShooter && collidedwith.Entity.Uid == Shooter; + return IgnoreShooter && collidedwith.Owner.Uid == Shooter; } } } diff --git a/Content.Shared/GameObjects/EntitySystems/SharedMobMoverSystem.cs b/Content.Shared/GameObjects/EntitySystems/SharedMobMoverSystem.cs index 353c1e3232..e0b2363a8a 100644 --- a/Content.Shared/GameObjects/EntitySystems/SharedMobMoverSystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/SharedMobMoverSystem.cs @@ -4,6 +4,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Dynamics; namespace Content.Shared.GameObjects.EntitySystems { @@ -24,13 +25,15 @@ namespace Content.Shared.GameObjects.EntitySystems /// /// Fake pushing for player collisions. /// - private void HandleCollisionMessage(IPhysBody ourBody, IPhysBody otherBody, float frameTime, Manifold manifold) + private void HandleCollisionMessage(Fixture ourFixture, Fixture otherFixture, float frameTime, Manifold manifold) { - if (otherBody.BodyType != BodyType.Dynamic) return; + var otherBody = otherFixture.Body; + + if (otherBody.BodyType != BodyType.Dynamic || !otherFixture.Hard) return; var normal = manifold.LocalNormal; - if (!ourBody.Entity.TryGetComponent(out IMobMoverComponent? mobMover) || normal == Vector2.Zero) return; + if (!ourFixture.Body.Owner.TryGetComponent(out IMobMoverComponent? mobMover) || normal == Vector2.Zero) return; otherBody.ApplyLinearImpulse(-normal * mobMover.PushStrength * frameTime); } diff --git a/Content.Shared/GameObjects/EntitySystems/ThrownItemSystem.cs b/Content.Shared/GameObjects/EntitySystems/ThrownItemSystem.cs index e38feb6105..50869cda91 100644 --- a/Content.Shared/GameObjects/EntitySystems/ThrownItemSystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/ThrownItemSystem.cs @@ -65,36 +65,36 @@ namespace Content.Shared.GameObjects.EntitySystems public void ThrowCollideInteraction(IEntity? user, IPhysBody thrown, IPhysBody target) { // TODO: Just pass in the bodies directly - var collideMsg = new ThrowCollideMessage(user, thrown.Entity, target.Entity); + var collideMsg = new ThrowCollideMessage(user, thrown.Owner, target.Owner); RaiseLocalEvent(collideMsg); if (collideMsg.Handled) { return; } - var eventArgs = new ThrowCollideEventArgs(user, thrown.Entity, target.Entity); + var eventArgs = new ThrowCollideEventArgs(user, thrown.Owner, target.Owner); - foreach (var comp in target.Entity.GetAllComponents()) + foreach (var comp in target.Owner.GetAllComponents()) { _throwCollide.Add(comp); } foreach (var collide in _throwCollide) { - if (target.Entity.Deleted) break; + if (target.Owner.Deleted) break; collide.HitBy(eventArgs); } _throwCollide.Clear(); - foreach (var comp in thrown.Entity.GetAllComponents()) + foreach (var comp in thrown.Owner.GetAllComponents()) { _throwCollide.Add(comp); } foreach (var collide in _throwCollide) { - if (thrown.Entity.Deleted) break; + if (thrown.Owner.Deleted) break; collide.DoHit(eventArgs); } diff --git a/Content.Shared/Physics/Controllers/SharedMoverController.cs b/Content.Shared/Physics/Controllers/SharedMoverController.cs index 0ad0c1a134..da89b6ded3 100644 --- a/Content.Shared/Physics/Controllers/SharedMoverController.cs +++ b/Content.Shared/Physics/Controllers/SharedMoverController.cs @@ -131,7 +131,7 @@ namespace Content.Shared.Physics.Controllers !otherCollider.CanCollide || ((collider.CollisionMask & otherCollider.CollisionLayer) == 0 && (otherCollider.CollisionMask & collider.CollisionLayer) == 0) || - (otherCollider.Entity.TryGetComponent(out SharedPullableComponent? pullable) && pullable.BeingPulled)) + (otherCollider.Owner.TryGetComponent(out SharedPullableComponent? pullable) && pullable.BeingPulled)) { continue; } diff --git a/Resources/Prototypes/Entities/Objects/Consumable/trash.yml b/Resources/Prototypes/Entities/Objects/Consumable/trash.yml index 340beecbc3..abe7e50871 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/trash.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/trash.yml @@ -185,14 +185,18 @@ - type: CollisionWake enabled: false - type: Physics - bodyType: KinematicController - fixtures: # TODO: Make a second fixture. One should be for slipping, and the other for collisions. + bodyType: Dynamic + fixtures: + - shape: + !type:PhysShapeAabb + bounds: "-0.2,-0.2,0.2,0.2" + name: "slips" + hard: false + layer: + - SmallImpassable - shape: !type:PhysShapeAabb bounds: "-0.2,-0.2,0.2,0.2" mass: 5 - layer: - - SmallImpassable mask: - - Impassable - - MobImpassable + - SmallImpassable diff --git a/Resources/Prototypes/Entities/Objects/Devices/pda.yml b/Resources/Prototypes/Entities/Objects/Devices/pda.yml index 7f2bc93a7b..8bfae7f892 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/pda.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/pda.yml @@ -88,18 +88,21 @@ - type: CollisionWake enabled: false - type: Physics - bodyType: KinematicController - fixtures: # TODO: Make a second fixture. + bodyType: Dynamic + fixtures: + - shape: + !type:PhysShapeAabb + bounds: "-0.3,-0.4,0.3,0.4" + name: "slips" + hard: false + layer: + - SmallImpassable - shape: !type:PhysShapeAabb bounds: "-0.3,-0.4,0.3,0.4" mass: 2.5 - hard: false - layer: - - SmallImpassable mask: - - Impassable - - MobImpassable + - SmallImpassable - type: entity name: Mime PDA diff --git a/Resources/Prototypes/Entities/Objects/Specific/janitor.yml b/Resources/Prototypes/Entities/Objects/Specific/janitor.yml index 298fd2f725..da5dff0f2e 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/janitor.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/janitor.yml @@ -109,17 +109,21 @@ - type: CollisionWake enabled: false - type: Physics - bodyType: KinematicController - fixtures: # TODO: Make a second fixture. One should be for slipping, and the other for collisions. + bodyType: Dynamic + fixtures: - shape: !type:PhysShapeAabb bounds: "-0.3,-0.4,0.3,0.4" - mass: 2.5 + name: "slips" + hard: false layer: - - SmallImpassable + - SmallImpassable + - shape: + !type:PhysShapeAabb + bounds: "-0.3,-0.4,0.3,0.4" + mass: 5 mask: - - Impassable - - MobImpassable + - SmallImpassable - type: entity name: soap diff --git a/RobustToolbox b/RobustToolbox index 3ec9e7a734..c1396f1c50 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 3ec9e7a7342f62fd30dd3c41bd7083424058110c +Subproject commit c1396f1c5001ad5052376737d18d702e01d30808