Revert "Content update for fixture changes (#5524)"

This reverts commit 0a843b671f.
This commit is contained in:
metalgearsloth
2021-12-01 13:55:24 +11:00
parent 6ccd1d7110
commit 43b637826d
108 changed files with 829 additions and 1023 deletions

View File

@@ -21,8 +21,9 @@ namespace Content.Server.Shuttles.EntitySystems
public sealed class DockingSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;
[Dependency] private readonly SharedBroadphaseSystem _broadphaseSystem = default!;
[Dependency] private readonly SharedJointSystem _jointSystem = default!;
[Dependency] private readonly AirtightSystem _airtightSystem = default!;
private const string DockingFixture = "docking";
private const string DockingJoint = "docking";
@@ -107,7 +108,7 @@ namespace Content.Server.Shuttles.EntitySystems
!EntityManager.HasComponent<ShuttleComponent>(grid.GridEntityId)) return null;
var transform = body.GetTransform();
var dockingFixture = _fixtureSystem.GetFixtureOrNull(body, DockingFixture);
var dockingFixture = body.GetFixture(DockingFixture);
if (dockingFixture == null)
{
@@ -141,7 +142,7 @@ namespace Content.Server.Shuttles.EntitySystems
!EntityManager.TryGetComponent(ent, out PhysicsComponent? otherBody)) continue;
var otherTransform = otherBody.GetTransform();
var otherDockingFixture = _fixtureSystem.GetFixtureOrNull(otherBody, DockingFixture);
var otherDockingFixture = otherBody.GetFixture(DockingFixture);
if (otherDockingFixture == null)
{
@@ -266,7 +267,7 @@ namespace Content.Server.Shuttles.EntitySystems
return;
}
_fixtureSystem.DestroyFixture(physicsComponent, DockingFixture);
_broadphaseSystem.DestroyFixture(physicsComponent, DockingFixture);
}
private void EnableDocking(EntityUid uid, DockingComponent component)
@@ -296,7 +297,7 @@ namespace Content.Server.Shuttles.EntitySystems
// TODO: I want this to ideally be 2 fixtures to force them to have some level of alignment buuuttt
// I also need collisionmanager for that yet again so they get dis.
_fixtureSystem.CreateFixture(physicsComponent, fixture);
_broadphaseSystem.CreateFixture(physicsComponent, fixture);
}
/// <summary>
@@ -384,8 +385,8 @@ namespace Content.Server.Shuttles.EntitySystems
return;
}
var fixtureA = _fixtureSystem.GetFixtureOrNull(bodyA, DockingFixture);
var fixtureB = _fixtureSystem.GetFixtureOrNull(bodyB, DockingFixture);
var fixtureA = bodyA.GetFixture(DockingFixture);
var fixtureB = bodyB.GetFixture(DockingFixture);
if (fixtureA == null || fixtureB == null)
{

View File

@@ -101,9 +101,6 @@ namespace Content.Server.Shuttles.EntitySystems
private void OnShuttleShutdown(EntityUid uid, ShuttleComponent component, ComponentShutdown args)
{
// None of the below is necessary for any cleanup if we're just deleting.
if (EntityManager.GetComponent<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating) return;
if (!component.Owner.TryGetComponent(out PhysicsComponent? physicsComponent))
{
return;

View File

@@ -28,7 +28,7 @@ namespace Content.Server.Shuttles.EntitySystems
{
[Robust.Shared.IoC.Dependency] private readonly IMapManager _mapManager = default!;
[Robust.Shared.IoC.Dependency] private readonly AmbientSoundSystem _ambient = default!;
[Robust.Shared.IoC.Dependency] private readonly FixtureSystem _fixtureSystem = default!;
[Robust.Shared.IoC.Dependency] private readonly SharedBroadphaseSystem _broadphase = default!;
[Robust.Shared.IoC.Dependency] private readonly DamageableSystem _damageable = default!;
// Essentially whenever thruster enables we update the shuttle's available impulses which are used for movement.
@@ -259,7 +259,7 @@ namespace Content.Server.Shuttles.EntitySystems
CollisionLayer = (int) CollisionGroup.MobImpassable
};
_fixtureSystem.CreateFixture(physicsComponent, fixture);
_broadphase.CreateFixture(physicsComponent, fixture);
}
break;
@@ -323,7 +323,7 @@ namespace Content.Server.Shuttles.EntitySystems
if (EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
{
_fixtureSystem.DestroyFixture(physicsComponent, BurnFixture);
_broadphase.DestroyFixture(physicsComponent, BurnFixture);
}
_activeThrusters.Remove(component);