Converted everything to use collision and physics component interfaces.
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents
|
||||
/// </summary>
|
||||
public bool Connectable => Anchored;
|
||||
|
||||
private bool Anchored => !Owner.TryGetComponent<PhysicsComponent>(out var physics) || physics.Anchored;
|
||||
private bool Anchored => !Owner.TryGetComponent<IPhysicsComponent>(out var physics) || physics.Anchored;
|
||||
|
||||
[ViewVariables]
|
||||
public bool NeedsProvider { get; private set; } = true;
|
||||
@@ -86,18 +86,18 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents
|
||||
{
|
||||
TryFindAndSetProvider();
|
||||
}
|
||||
if (Owner.TryGetComponent<PhysicsComponent>(out var physics))
|
||||
if (Owner.TryGetComponent<IPhysicsComponent>(out var physics))
|
||||
{
|
||||
AnchorUpdate();
|
||||
physics.AnchoredChanged += AnchorUpdate;
|
||||
((IPhysicsComponent) physics).AnchoredChanged += AnchorUpdate;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRemove()
|
||||
{
|
||||
if (Owner.TryGetComponent<PhysicsComponent>(out var physics))
|
||||
if (Owner.TryGetComponent<IPhysicsComponent>(out var physics))
|
||||
{
|
||||
physics.AnchoredChanged -= AnchorUpdate;
|
||||
((IPhysicsComponent) physics).AnchoredChanged -= AnchorUpdate;
|
||||
}
|
||||
_provider.RemoveReceiver(this);
|
||||
base.OnRemove();
|
||||
|
||||
Reference in New Issue
Block a user