Content update for ECS physics (#13291)
This commit is contained in:
@@ -28,21 +28,12 @@ public abstract class SharedFlyBySoundSystem : EntitySystem
|
||||
|
||||
private void OnStartup(EntityUid uid, FlyBySoundComponent component, ComponentStartup args)
|
||||
{
|
||||
if (!TryComp<PhysicsComponent>(uid, out var body)) return;
|
||||
if (!TryComp<PhysicsComponent>(uid, out var body))
|
||||
return;
|
||||
|
||||
var shape = new PhysShapeCircle()
|
||||
{
|
||||
Radius = component.Range,
|
||||
};
|
||||
var shape = new PhysShapeCircle(component.Range);
|
||||
|
||||
var fixture = new Fixture(body, shape)
|
||||
{
|
||||
Hard = false,
|
||||
ID = FlyByFixture,
|
||||
CollisionLayer = (int) CollisionGroup.MobMask,
|
||||
};
|
||||
|
||||
_fixtures.TryCreateFixture(body, fixture);
|
||||
_fixtures.TryCreateFixture(uid, shape, FlyByFixture, collisionLayer: (int) CollisionGroup.MobMask, hard: false, body: body);
|
||||
}
|
||||
|
||||
private void OnShutdown(EntityUid uid, FlyBySoundComponent component, ComponentShutdown args)
|
||||
@@ -53,7 +44,7 @@ public abstract class SharedFlyBySoundSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
_fixtures.DestroyFixture(body, FlyByFixture);
|
||||
_fixtures.DestroyFixture(uid, FlyByFixture, body: body);
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, FlyBySoundComponent component, ref ComponentHandleState args)
|
||||
|
||||
Reference in New Issue
Block a user