Content change from mass to density (#11533)

This commit is contained in:
metalgearsloth
2022-10-04 15:48:23 +11:00
committed by GitHub
parent 6ca51d0dbf
commit 4ef144d865
148 changed files with 180790 additions and 181305 deletions

View File

@@ -17,6 +17,7 @@ namespace Content.Server.Shuttles.Systems
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly FixtureSystem _fixtures = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
private ISawmill _sawmill = default!;
@@ -85,7 +86,7 @@ namespace Content.Server.Shuttles.Systems
foreach (var fixture in args.NewFixtures)
{
_fixtures.SetMass(fixture, fixture.Area * TileMassMultiplier, manager, false);
_physics.SetDensity(fixture, TileMassMultiplier, manager, false);
_fixtures.SetRestitution(fixture, 0.1f, manager, false);
}
@@ -158,16 +159,6 @@ namespace Content.Server.Shuttles.Systems
}
Disable(physicsComponent);
if (!EntityManager.TryGetComponent(component.Owner, out FixturesComponent? fixturesComponent))
{
return;
}
foreach (var fixture in fixturesComponent.Fixtures.Values)
{
fixture.Mass = 0f;
}
}
}
}